:root {
  --ink: #111;
  --body: #222;
  --soft: #3d3d3d;
  --muted: #707070;
  --rule: #e5e5e5;
  --wash: #f5f5f5;
  --bg: #fff;
  --link: #0000ee;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--bg); }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Links inside sentences use the classic blue; navigation and the issue list stay black. */
.subhead a, .prose a { color: var(--link); }

.wrap {
  max-width: 660px;
  margin: 0 auto;
  padding: 88px 20px 112px;
}

/* ---------- Homepage ---------- */

.name {
  margin: 0 0 32px;
  font-size: clamp(48px, 11vw, 76px);
  line-height: 0.95;
  font-weight: 800;
  letter-spacing: -0.045em;
}

/* Color-changing bits: the period after "Not Slop" on the homepage, and the period and border of
   the signup box on issue pages. They flick through Sun Powder's brand colors plus a few fun
   extras, holding each one for 0.5s (11 colors x 0.5s = 5.5s per loop).
   The color lives in --brand, so anything can use it with var(--brand) plus the animation.
   People who've turned on "reduce motion" see it stay black instead. */
@property --brand {
  syntax: "<color>";
  inherits: false;
  initial-value: #111;
}
.dot { color: var(--brand); }
@media (prefers-reduced-motion: no-preference) {
  .dot, .subscribe-panel { animation: brand-colors 5.5s step-end infinite; }
}
@keyframes brand-colors {
  0%     { --brand: #ff4101; } /* red-orange */
  9.09%  { --brand: #031c73; } /* navy */
  18.18% { --brand: #ff2d95; } /* hot pink */
  27.27% { --brand: #fe9c02; } /* orange */
  36.36% { --brand: #7b2ff7; } /* electric purple */
  45.45% { --brand: #94c54e; } /* green */
  54.55% { --brand: #fe5d5c; } /* coral */
  63.64% { --brand: #6394e3; } /* sky blue */
  72.73% { --brand: #ffb040; } /* sunny amber */
  81.82% { --brand: #9c3256; } /* berry */
  90.91% { --brand: #00b3a4; } /* teal */
}

.headline {
  margin: 0 0 14px;
  font-size: clamp(22px, 4.4vw, 26px);
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.subhead {
  margin: 0;
  max-width: 34em;
  color: var(--soft);
}

.label {
  margin: 80px 0 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.issue-list { list-style: none; margin: 0; padding: 0; }
.issue-list li { border-bottom: 1px solid var(--rule); }

.issue-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
  align-items: baseline;
  padding: 20px 0;
  text-decoration: none;
}

.issue-list time {
  font: 14px/1.4 var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.issue-list .title {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.issue-list a:hover .title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

@media (max-width: 540px) {
  .wrap { padding-top: 56px; }
  .issue-list a { grid-template-columns: 1fr; row-gap: 4px; }
}

/* ---------- Issue page ---------- */

.top { margin-bottom: 64px; font-size: 15px; font-weight: 600; }
.top a { text-decoration: none; }
.top a:hover { text-decoration: underline; }

.meta {
  margin: 0 0 14px;
  font: 14px/1.4 var(--mono);
  color: var(--muted);
}

.issue-head h1 {
  margin: 0 0 44px;
  font-size: clamp(32px, 6.4vw, 46px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.prose { color: var(--body); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose figure, .prose table { margin: 0 0 1.25em; }

.prose h2 {
  margin: 2.2em 0 0.6em;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.prose h3 {
  margin: 1.8em 0 0.5em;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
}

.prose strong { color: var(--ink); font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0; }

.prose blockquote {
  padding-left: 18px;
  border-left: 3px solid var(--ink);
  color: var(--soft);
}
.prose blockquote > :last-child { margin-bottom: 0; }

.prose code {
  padding: 0.12em 0.35em;
  background: var(--wash);
  font: 0.85em/1.5 var(--mono);
}
.prose pre {
  overflow-x: auto;
  padding: 16px 18px;
  background: var(--wash);
  font: 14px/1.55 var(--mono);
}
.prose pre code { padding: 0; background: none; font-size: inherit; white-space: pre; }

.prose img, .prose video {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}
.prose img.zoomable { cursor: zoom-in; }
.prose figure { margin: 2em 0; }
.prose figcaption { margin-top: 10px; font-size: 15px; line-height: 1.45; color: var(--muted); text-align: center; }

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

.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.prose th { color: var(--ink); font-weight: 650; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}
.pager a { text-decoration: none; }
.pager a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.pager small {
  display: block;
  margin-bottom: 6px;
  font: 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager span { font-weight: 600; line-height: 1.35; }
.pager .next { grid-column: 2; text-align: right; }

@media (max-width: 540px) {
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; text-align: left; }
}

/* ---------- Email signup (Kit) ---------- */

.subscribe-home { margin-top: 32px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.subscribe-panel {
  margin-top: 72px;
  padding: 24px;
  border: 2px solid var(--brand);
  background: var(--wash);
}

.subscribe-label {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.subscribe-row { display: flex; gap: 8px; max-width: 480px; }

.subscribe-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid #8c8c8c;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1 var(--sans);
}
.subscribe-input::placeholder { color: #8c8c8c; opacity: 1; }
.subscribe-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.subscribe-button {
  flex: none;
  height: 48px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  font: 600 16px/1 var(--sans);
  cursor: pointer;
}
.subscribe-button:hover { background: #333; }
.subscribe-button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.subscribe-button:disabled { opacity: 0.55; cursor: default; }

.subscribe-note { margin: 10px 0 0; font-size: 14px; line-height: 1.45; color: #5c5c5c; }
.subscribe-note:focus { outline: none; }
.subscribe.is-error .subscribe-note { color: #b3261e; }
.subscribe.is-done .subscribe-row { display: none; }
.subscribe.is-done .subscribe-note { margin-top: 0; font-size: 16px; color: var(--ink); }

@media (max-width: 400px) {
  .subscribe-row { flex-direction: column; }
  .subscribe-input { flex: none; }
}

/* ---------- Image preview (lightbox) ---------- */

html.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: none;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(28, 28, 28, 0.62); }

.lightbox-img {
  display: block;
  max-width: min(94vw, 1800px);
  max-height: 86vh;
  max-height: 86dvh;
  width: auto;
  height: auto;
  background: #fff;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
.lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .lightbox[open], .lightbox[open]::backdrop { animation: lightbox-fade 0.16s ease-out; }
}
@keyframes lightbox-fade { from { opacity: 0; } }
