:root {
  --ink: #000000;
  --paper: #f4f1f7;
  --muted: rgba(244, 241, 247, 0.8);
  --quiet: rgba(244, 241, 247, 0.58);
  --line: rgba(244, 241, 247, 0.14);
  --fringe-cyan: rgba(157, 205, 245, 0.34);
  --fringe-violet: rgba(207, 169, 234, 0.26);
  --font-display: "EB Garamond", Georgia, serif;
  --font-body: "Baskervville", Georgia, serif;
  --font-label: "Abel", Arial, sans-serif;
  /* Gothic eyebrow, after the portfolio site's Oswald labels (light, tracked caps). */
  --font-eyebrow: "Oswald", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
  --column-indent: clamp(20px, 16vw, 260px);
  /* H1 knockout grid: tile size and knockout stroke width (stroke < cell). */
  --h1-grid-cell: 5px;
  --h1-grid-line: 4px;
  /* H1 scrim (mobile): glow strength 0-1 and blur radius of the wide halo. */
  --h1-scrim: 0.5;
  --h1-scrim-spread: 0.22em;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Crops the h1's side-bleed at the viewport edge (the hero no longer clips,
     so the title can overhang its bottom edge). */
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.6;
  /* Light-on-black renders bolder than the font's true weight on macOS
     without this; keeps the serif from thickening up. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("stars.svg?v=4") center / cover no-repeat;
}

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

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

section[id] {
  scroll-margin-top: 100px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 80px;
  padding: 18px 40px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(244, 241, 247, 0.08);
}

.brand img {
  width: 86px;
  height: auto;
}

.nav-link {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 15px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid transparent;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--quiet);
}

.nav-link-end {
  justify-self: end;
}

.hero {
  position: relative;
  height: min(76vh, 720px);
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 28%;
  filter: brightness(0.76) contrast(1.06);
}

/* Pixel grid over the hero, after nicksternberg.com/story. Painted below ::after
   so the fade gradients dissolve the grid along with the image — no grid lines
   surviving into the pure-black page ground. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1; /* the img's filter promotes it to this stacking level; sit above it */
  pointer-events: none;
  opacity: 0.8;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.28) 1px, transparent 1px);
  background-size: 4px 4px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 26%, rgba(0, 0, 0, 0) 74%, var(--ink) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.25) 38%, rgba(0, 0, 0, 0) 62%);
}

/* Giant display headline, bleeding just past the hero's edges — the section's
   overflow:hidden crops the outermost glyph edges. Insets are in em so the
   bleed scales with the type. */
.hero h1 {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: -0.35em; /* straddles the hero's bottom edge, overhanging onto the page */
  margin: 0;
  font-family: var(--font-display);
  font-size: 13vw; /* sized past the viewport; nowrap + center bleeds both ends evenly */
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-align: center;
  color: var(--paper);
}

/* Grid knocked out of the letterforms: two stripe layers intersected, so the
   hero image shows through the lines. Lives on the inner span so the h1 itself
   stays unmasked and can carry a glow behind the letters (see mobile block).
   Tune via --h1-grid-* vars. */
.hero h1 > span {
  position: relative;
  z-index: 1;
  display: block;
  -webkit-mask-image:
    linear-gradient(transparent var(--h1-grid-line), #fff var(--h1-grid-line)),
    linear-gradient(90deg, transparent var(--h1-grid-line), #fff var(--h1-grid-line));
  -webkit-mask-size: var(--h1-grid-cell) var(--h1-grid-cell);
  -webkit-mask-repeat: repeat;
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(transparent var(--h1-grid-line), #fff var(--h1-grid-line)),
    linear-gradient(90deg, transparent var(--h1-grid-line), #fff var(--h1-grid-line));
  mask-size: var(--h1-grid-cell) var(--h1-grid-cell);
  mask-repeat: repeat;
  mask-composite: intersect;
}

.column {
  max-width: 820px;
  margin-left: var(--column-indent);
  padding: 0 24px 0 0;
}

.opening {
  padding-top: 120px;
}

.opening p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: clamp(19px, 1.4vw, 21px);
}

.essay-title {
  margin: 0 0 34px;
  font-size: clamp(28px, 2.8vw, 36px);
}

.opening .rule {
  margin: 56px 0 48px;
}
.rule {
  width: 72px;
  border-top: 1px solid rgba(244, 241, 247, 0.32);
}

.book {
  padding-top: 96px;
}

.book .byline {
  margin: -18px 0 28px;
  color: var(--quiet);
  font-style: italic;
  font-size: 17px;
}

/* Text left, plate right at desktop widths. */
@media (min-width: 1000px) {
  .book {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 440px);
    column-gap: 56px;
    max-width: 1000px;
  }

  .book > * {
    grid-column: 1;
  }

  .book .plate {
    grid-column: 2;
    /* Row 1 with an oversized span: the plate top always sits level with the
       section's first text element, however many siblings exist. Unused
       implicit rows are zero-height, so the span is harmless. */
    grid-row: 1 / span 20;
    align-self: start;
    margin: 0;
    max-width: none;
  }
}

.lead-in {
  margin: 36px 0 10px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 19px;
}

h2 {
  margin: 0 0 26px;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 500;
  line-height: 1.2;
}

.book p {
  margin: 0 0 24px;
  color: var(--muted);
}

.plate {
  margin: 52px 0 10px;
  max-width: 460px;
}

.plate img {
  filter: brightness(0.85) contrast(1.08);
}

/* Splide carousel inside the plate, restyled to the page's register:
   square frame, quiet arrows, caption swaps per slide. */
.plate .splide__slide img {
  display: block;
  width: 100%;
  height: auto; /* beat the height="960" attribute so aspect-ratio wins */
  aspect-ratio: 1;
  object-fit: cover;
  filter: brightness(0.85) contrast(1.08);
}

.plate .splide__arrow {
  width: 36px;
  height: 36px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0.8;
}

.plate .splide__arrow svg {
  width: 14px;
  height: 14px;
  fill: var(--paper);
}

.plate .splide__arrow:hover,
.plate .splide__arrow:focus-visible {
  opacity: 1;
}

.plate figcaption {
  min-height: 36px; /* two-line captions won't shift the colophon below */
  margin-top: 12px;
  color: var(--quiet);
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.colophon {
  max-width: 460px;
  margin: 40px 0 42px;
}

.colophon div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.colophon dt {
  color: var(--quiet);
  font-family: var(--font-eyebrow);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.colophon dd {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin: 0;
}

.buy-note {
  color: var(--quiet);
  font-family: var(--font-eyebrow);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.buy-button {
  display: inline-block;
  padding: 13px 34px;
  border: 1px solid rgba(244, 241, 247, 0.5);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.3;
  transition: background 0.15s ease, color 0.15s ease;
}

.buy-button:hover,
.buy-button:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.conversation {
  padding-top: 104px;
  padding-bottom: 120px;
}

.conversation h2 {
  max-width: 480px;
  margin: 36px 0 0;
  color: var(--muted);
  font-size: clamp(22px, 2.2vw, 27px);
  font-weight: 400;
  line-height: 1.35;
}

.newsletter {
  position: relative;
  width: min(100%, 420px);
  margin-top: 34px;
}

.newsletter label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.newsletter input {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-bottom: 1px solid rgba(244, 241, 247, 0.35);
  border-radius: 0;
  padding: 0 52px 0 2px;
  color: var(--paper);
  background: transparent;
  font-family: var(--font-label);
  font-size: 17px;
}

.newsletter input:focus-visible {
  outline: none;
  border-bottom-color: rgba(244, 241, 247, 0.7);
  box-shadow: 0 1px 0 var(--fringe-cyan), 0 2px 0 var(--fringe-violet);
}

.newsletter button {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.newsletter button:hover,
.newsletter button:focus-visible {
  color: var(--paper);
}

.form-note {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--quiet);
  font-family: var(--font-label);
  font-size: 15px;
}

.newsletter.is-done input,
.newsletter.is-done button {
  opacity: 0.45;
  pointer-events: none;
}

.newsletter.is-done .form-note {
  color: var(--muted);
}

.contact-line {
  margin: 26px 0 0;
  color: var(--quiet);
  font-size: 16px;
}

.contact-line a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.substack-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  color: var(--quiet);
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.substack-chip svg {
  width: 12px;
  height: 12px;
}

.substack-chip:hover,
.substack-chip:focus-visible {
  color: var(--paper);
  border-color: rgba(244, 241, 247, 0.4);
}

/* Policy pages (privacy/shipping/terms/refunds). */
.policy {
  padding-top: 72px;
  padding-bottom: 110px;
}

.policy h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.15;
}

.policy-updated {
  margin: 0 0 44px;
  color: var(--quiet);
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.policy h2 {
  margin: 44px 0 14px;
  font-size: clamp(20px, 1.9vw, 24px);
}

.policy p,
.policy li {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.policy ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.policy li {
  margin-bottom: 10px;
}

.policy a {
  border-bottom: 1px solid rgba(244, 241, 247, 0.36);
}

.policy a:hover,
.policy a:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--quiet);
}

/* Centered stack, echoing the header's centered brand. */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  border-top: 1px solid var(--line);
  margin: 0 40px;
  padding: 44px 0 38px;
  color: var(--quiet);
  text-align: center;
}

.socials {
  display: flex;
  gap: 26px;
}

.socials a,
.legal a {
  color: var(--quiet);
  font-family: var(--font-label);
  font-size: 14px;
}

.socials a:hover,
.socials a:focus-visible,
.legal a:hover,
.legal a:focus-visible {
  color: var(--paper);
}

.legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  width: 100%;
  margin-top: 6px;
  font-family: var(--font-label);
  font-size: 13px;
  color: rgba(244, 241, 247, 0.5);
}

@media (max-width: 760px) {
  body {
    font-size: 17px;
  }

  .site-header {
    min-height: 72px;
    padding: 16px 20px;
  }

  .brand img {
    width: 74px;
  }

  .nav-link {
    font-size: 14px;
  }

  .hero {
    height: min(64vh, 520px);
  }

  /* Headline dots: at ~50px type the 5px cell leaves only ~10 dots per glyph
     height. 3px cells tighten that to ~17 while keeping 1px dots. */
  .hero h1 {
    --h1-grid-cell: 3px;
    --h1-grid-line: 2px;
    /* One word per line: min-content shrinks the box to the longest word, so
       every space becomes a break. Left-aligned to the page gutter. */
    white-space: normal;
    width: min-content;
    margin: 0 0 0 20px;
    text-align: left;
    /* Four stacked lines plus the .3em lift must fit the hero, min(64vh, 520px).
       28vw sizes for phones; 13.5vh caps wide-short screens (tablets, landscape);
       110px caps anything larger that still hits this breakpoint. */
    font-size: min(28vw, 13.5vh, 110px);
    bottom: 0.3em;
  }

  /* Scrim behind the letters only: a transparent duplicate of the text (from
     data-text) sits under the masked span and casts a soft black glow, so the
     darkening follows the glyphs rather than washing the whole hand. */
  .hero h1::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    z-index: 0;
    color: transparent;
    opacity: var(--h1-scrim);
    text-shadow:
      0 0 0.08em rgba(0, 0, 0, 0.85),
      0 0 var(--h1-scrim-spread) rgba(0, 0, 0, 0.6);
  }

  .column {
    max-width: none;
    margin-left: 0;
    padding: 0 20px;
  }

  .opening {
    padding-top: 64px;
  }

  .opening p {
    font-size: 18px;
  }

  .book {
    padding-top: 64px;
  }

  .plate {
    margin: 40px 0 8px;
  }

  .conversation {
    padding-top: 72px;
    padding-bottom: 80px;
  }

  .site-footer {
    gap: 16px;
    margin: 0 20px;
  }
}
