/* ════════════════════════════════════════════════════════
   Palette, type scale, spacing
   ════════════════════════════════════════════════════════ */
:root {
  --void:    #0E1113;
  --raise:   #171B1F;
  --edge:    #232A30;
  --ink:     #EAE7E1;
  --haze:    #8E959B;
  --signal:  #B9A3FF;
  --signal-soft: rgba(185, 163, 255, 0.14);

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body:    "Newsreader", Georgia, "Times New Roman", serif;
  --util:    "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 34rem;
  --gutter:  clamp(1.25rem, 5vw, 3rem);
  --r:       4px;
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.06rem, 0.98rem + 0.35vw, 1.2rem);
  line-height: 1.7;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

::selection { background: var(--signal); color: var(--void); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--signal);
  color: var(--void);
  padding: 0.6rem 1rem;
  font-family: var(--util);
  font-size: 0.8rem;
  z-index: 99;
}
.skip:focus { left: 0; }

/* Small uppercase utility label, used in several places */
.eyebrow {
  font-family: var(--util);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--haze);
  margin: 0;
}
.eyebrow .sep, .colophon .sep { opacity: 0.4; padding: 0 0.5em; }

/* ════════════════════════════════════════════════════════
   Masthead — floats over whatever is at the top of the page
   ════════════════════════════════════════════════════════ */
.masthead {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  padding: clamp(1.2rem, 3vw, 2rem) var(--gutter);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--util);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
}

.mark-glyph {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0 var(--signal-soft);
  flex: none;
}
.mark:hover .mark-glyph { animation: pulse 1.6s ease-out infinite; }

@keyframes pulse {
  to { box-shadow: 0 0 0 12px rgba(185, 163, 255, 0); }
}

/* ════════════════════════════════════════════════════════
   Home
   ════════════════════════════════════════════════════════ */
.intro {
  padding: clamp(7rem, 18vh, 11rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
  max-width: 60rem;
  margin: 0 auto;
}

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 12vw, 6.5rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
}

.tagline {
  font-family: var(--util);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--haze);
  margin: 1.4rem 0 0;
}

.empty {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 6rem;
  color: var(--haze);
}
.empty code {
  font-family: var(--util);
  font-size: 0.85em;
  background: var(--raise);
  padding: 0.15em 0.45em;
  border-radius: var(--r);
  color: var(--signal);
}

.feed {
  list-style: none;
  margin: 0 auto;
  padding: 0 0 clamp(4rem, 12vw, 8rem);
  max-width: 60rem;
  border-top: 1px solid var(--edge);
}

.entry { border-bottom: 1px solid var(--edge); }

.entry > a {
  position: relative;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  grid-template-areas:
    "date title"
    ".    excerpt";
  gap: 0.35rem 1.5rem;
  align-items: baseline;
  padding: clamp(1.6rem, 4vw, 2.4rem) var(--gutter);
  text-decoration: none;
  color: inherit;
  isolation: isolate;
}

/* The backdrop of each post washes in behind its own row */
.entry-wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 420ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.3, 1);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 22%, #000 78%, transparent);
}
.entry > a:hover .entry-wash,
.entry > a:focus-visible .entry-wash {
  opacity: 0.26;
  transform: scale(1);
}

.entry-date {
  grid-area: date;
  font-family: var(--util);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--haze);
  transition: color 200ms ease;
}
.entry > a:hover .entry-date { color: var(--signal); }

.entry-title {
  grid-area: title;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.4vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

.entry-excerpt {
  grid-area: excerpt;
  margin: 0.3rem 0 0;
  color: var(--haze);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 44ch;
}

/* ════════════════════════════════════════════════════════
   Post hero — image dissolves into the page, title sits on
   the seam. This is the one loud move on the site.
   ════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: min(78vh, 46rem);
  display: flex;
  align-items: flex-end;
  padding: 6rem var(--gutter) clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: settle 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(14, 17, 19, 0.42) 0%,
      rgba(14, 17, 19, 0.06) 22%,
      rgba(14, 17, 19, 0.10) 44%,
      rgba(14, 17, 19, 0.72) 78%,
      var(--void) 99%);
}

@keyframes settle {
  from { transform: scale(1.06); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Fallback when a post has no backdrop image */
.hero-plain { min-height: min(52vh, 32rem); }
.hero-plain .hero-media {
  background-image:
    radial-gradient(120% 90% at 15% 0%, rgba(185, 163, 255, 0.16), transparent 60%),
    radial-gradient(90% 70% at 85% 10%, rgba(120, 200, 190, 0.09), transparent 55%);
  background-color: var(--raise);
  animation: none;
}
.hero-plain .hero-media::after {
  background: linear-gradient(to bottom, transparent 40%, var(--void) 100%);
}

.hero-copy {
  position: relative;
  max-width: 46rem;
  width: 100%;
  margin: 0 auto;
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0.7rem 0 0;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.hero-copy .eyebrow { text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7); }

/* ════════════════════════════════════════════════════════
   Post body
   ════════════════════════════════════════════════════════ */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4.5rem) var(--gutter) clamp(3rem, 8vw, 5rem);
}

.prose > * { margin: 0 0 1.35em; }
.prose > *:last-child { margin-bottom: 0; }

.prose h2, .prose h3, .prose h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin: 2.4em 0 0.7em;
  text-wrap: balance;
}
.prose h2 { font-size: 1.65em; }
.prose h3 { font-size: 1.28em; }
.prose h4 { font-size: 1.08em; color: var(--haze); }

.prose a {
  color: var(--signal);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(185, 163, 255, 0.4);
  transition: text-decoration-color 160ms ease;
}
.prose a:hover { text-decoration-color: var(--signal); }

.prose strong { font-weight: 600; }

.prose blockquote {
  margin-inline: 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--signal);
  font-style: italic;
  color: var(--haze);
}

.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--signal); }

.prose hr {
  border: 0;
  height: 1px;
  background: var(--edge);
  margin: 3em 0;
}

.prose code {
  font-family: var(--util);
  font-size: 0.85em;
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  padding: 0.12em 0.4em;
}

.prose pre {
  background: var(--raise);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Images in the body break out past the text column */
.prose img {
  width: calc(100% + 2 * clamp(0rem, 4vw, 4rem));
  margin-inline: clamp(0rem, -4vw, 0rem);
  max-width: none;
  border-radius: var(--r);
}
@media (min-width: 48rem) {
  .prose img {
    width: calc(100% + 8rem);
    margin-inline: -4rem;
  }
}

.prose em.caption, .prose p > em:only-child {
  display: block;
  font-family: var(--util);
  font-style: normal;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--haze);
  margin-top: -0.9em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--edge);
}
.prose th {
  font-family: var(--util);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--haze);
  font-weight: 500;
}

/* ════════════════════════════════════════════════════════
   Prev / next
   ════════════════════════════════════════════════════════ */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(3rem, 8vw, 5rem);
}

.post-nav-item {
  display: grid;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
  transition: border-color 200ms ease;
}
.post-nav-item:hover { border-color: var(--signal); }
.align-end { text-align: right; }

.post-nav-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* ════════════════════════════════════════════════════════
   Footer — links + contact, on every page
   ════════════════════════════════════════════════════════ */
.foot {
  border-top: 1px solid var(--edge);
  background: var(--raise);
  padding: clamp(3rem, 8vw, 5rem) var(--gutter) 2rem;
}

.foot-grid {
  max-width: 60rem;
  margin: 0 auto;
  display: grid;
  gap: clamp(2.5rem, 6vw, 5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

.foot .eyebrow { margin-bottom: 1.2rem; }

.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li + li { margin-top: 0.15rem; }

.linklist a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  padding: 0.15rem 0;
}
.linklist .tick {
  font-family: var(--util);
  font-size: 0.8rem;
  color: var(--edge);
  transform: translateX(-4px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease, color 220ms ease;
}
.linklist a:hover { color: var(--signal); }
.linklist a:hover .tick { opacity: 1; transform: translateX(0); color: var(--signal); }

.foot-note {
  margin: 0 0 1rem;
  color: var(--haze);
  font-size: 0.98rem;
  max-width: 32ch;
}

.mailto {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.1rem, 3.5vw, 1.5rem);
  letter-spacing: -0.015em;
  color: var(--signal);
  text-decoration: none;
  border-bottom: 1px solid var(--signal-soft);
  padding-bottom: 4px;
  transition: border-color 200ms ease;
  word-break: break-word;
}
.mailto:hover { border-color: var(--signal); }

.colophon {
  max-width: 60rem;
  margin: clamp(3rem, 8vw, 5rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--edge);
  font-family: var(--util);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--haze);
}

/* ════════════════════════════════════════════════════════
   Touch + motion
   ════════════════════════════════════════════════════════ */
@media (hover: none) {
  /* No hover on touch, so let each row show a hint of its image */
  .entry-wash { opacity: 0.16; transform: none; }
  .entry > a { grid-template-columns: 1fr; grid-template-areas: "date" "title" "excerpt"; }
  .entry-date { margin-bottom: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
