:root {
  --bg: #000000;
  --text: #FFFFFF;
  --soft: #E4E4E4;
  --muted: #8C8C8C;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #D4B896;
  --serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --max: 1240px;
  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* The site is black by design in every viewer setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #000000; --text: #FFFFFF; --soft: #E4E4E4; --muted: #8C8C8C; }
}
:root[data-theme="dark"] { --bg: #000000; --text: #FFFFFF; --soft: #E4E4E4; --muted: #8C8C8C; }

*, *::before, *::after { box-sizing: border-box; }
html { background: #000; scroll-padding-top: env(safe-area-inset-top, 0px); -webkit-text-size-adjust: 100%; }
body {
  position: relative;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: clamp(20px, 4.5vw, 56px);
  padding-right: clamp(20px, 4.5vw, 56px);
}

/* Header */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 32px;
  padding-top: 26px;
  padding-bottom: 26px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
  color: var(--text);
}
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 26px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav .nav-subscribe {
  color: var(--text);
  border: 1px solid var(--text);
  border-radius: 999px;
  padding: 7px 18px;
}
.nav .nav-subscribe:hover { background: var(--text); color: var(--bg); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: transparent; color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--text); color: var(--bg); }

/* Hero */
.hero-track { position: relative; height: 190vh; }
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-copy {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(36px, 7vh, 80px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.hero-copy.is-hidden { opacity: 0; transform: translateY(18px); }
.hero-title {
  margin: 0;
  max-width: 19em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 4.3vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.hero-title .first { color: var(--muted); }
.hero-lede { margin: 22px 0 0; max-width: 34em; color: var(--muted); font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

@media (max-width: 800px), (max-height: 640px) {
  .hero-track { height: auto; }
  .hero-sticky { position: relative; height: auto; padding-top: max(330px, 46vh); }
}

/* Sections */
.section { padding-top: clamp(72px, 10vw, 140px); padding-bottom: clamp(56px, 8vw, 110px); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.section-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.btn-shuffle {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  font: 500 0.95rem var(--sans);
  cursor: pointer;
}
.btn-shuffle:hover { border-color: var(--text); }
.section-foot { margin-top: 48px; }
.text-link { color: var(--text); text-underline-offset: 6px; text-decoration-thickness: 1px; font-weight: 500; }

/* Reveal: one style, used for large headings only */
[data-reveal] { overflow: hidden; }
[data-reveal] > span { display: block; transform: translateY(105%); transition: transform 1s cubic-bezier(0.2, 0.7, 0.1, 1); }
[data-reveal].is-in > span { transform: none; }

/* Tiles */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 28px; }
.tile { display: block; text-decoration: none; color: inherit; }
.tile-img { aspect-ratio: 4 / 5; overflow: hidden; background: #111; }
.tile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.tile:hover .tile-img img { transform: scale(1.04); }
.tile-date { display: block; margin-top: 18px; color: var(--muted); font-size: 0.9rem; }
.tile-title { margin: 6px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.2vw, 2rem); line-height: 1.08; }
.tile:hover .tile-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; gap: 44px; } }

/* Guest band */
.band { border-top: 1px solid var(--line); padding: clamp(64px, 9vw, 120px) 0; }
.band-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px 64px; align-items: end; }
.band-title { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 4.6vw, 4.2rem); line-height: 1.02; }
.band-side p { margin: 0 0 24px; color: var(--muted); max-width: 30em; }
@media (max-width: 800px) { .band-inner { grid-template-columns: 1fr; } }

/* Inner pages */
.page { padding-top: clamp(120px, 16vw, 200px); padding-bottom: clamp(64px, 9vw, 120px); }
.page-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.6rem, 11vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.page-lede { margin: 28px 0 0; max-width: 32em; color: var(--muted); font-size: 1.15rem; }
.prose { margin-top: clamp(40px, 6vw, 80px); }
.prose .lead { max-width: 22em; margin: 0 0 1.2em; font-family: var(--serif); font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.12; }
.prose p, .prose ol { max-width: 62ch; margin: 0 0 1.4em; color: var(--soft); font-size: 1.125rem; line-height: 1.75; }
.prose h2 { margin: 2em 0 0.6em; font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; }
.prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.7em; padding-left: 0.3em; }
.prose a { text-underline-offset: 5px; }

/* Article */
.article-title {
  margin: 0;
  max-width: 15em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.article-meta { margin: 24px 0 0; color: var(--muted); }
.article-cover { margin-top: clamp(40px, 6vw, 72px); aspect-ratio: 16 / 8; overflow: hidden; background: #111; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); }
.article-body { max-width: 64ch; margin: clamp(40px, 6vw, 72px) auto 0; color: var(--soft); font-size: 1.15rem; line-height: 1.78; }
.article-body p { margin: 0 0 1.4em; }
.article-body h2 { margin: 2em 0 0.6em; color: var(--text); font-family: var(--serif); font-weight: 400; font-size: 2.1rem; line-height: 1.1; }
.article-body blockquote { margin: 1.8em 0; color: var(--text); font-family: var(--serif); font-style: italic; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.2; }
.article-end { max-width: 64ch; font-size: 1.15rem; margin: 72px auto 0; padding-top: 36px; border-top: 1px solid var(--line); }
.article-end p { margin: 0 0 24px; font-family: var(--serif); font-size: 1.8rem; line-height: 1.15; }
.article-end .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 56px; color: var(--muted); font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; }
.site-footer a { color: var(--muted); text-underline-offset: 4px; }
.site-footer a:hover { color: var(--text); }


/* Profile list states */
.tile-img.no-image { background: radial-gradient(120% 90% at 30% 20%, #2a2a2a 0%, #0d0d0d 70%); }
.posts-empty { padding: 8px 0 0; }
.posts-empty p { margin: 0 0 10px; max-width: 26em; font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; }
.posts-empty .muted { font-family: var(--sans); font-size: 1.05rem; color: var(--muted); }
.posts-empty a { color: var(--text); text-underline-offset: 5px; }
.loading { color: var(--muted); }
[hidden] { display: none !important; }

/* Substack article content */
.article-body img { max-width: 100%; height: auto; }
.article-body figure { margin: 2em 0; }
.article-body figcaption { margin-top: 8px; color: var(--muted); font-size: 0.9rem; }
.article-body a { color: var(--text); text-underline-offset: 4px; }
.article-body ul, .article-body ol { padding-left: 1.3em; margin: 0 0 1.4em; }
.article-body li { margin-bottom: 0.5em; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.article-body pre { overflow-x: auto; }
.article-body h3 { margin: 1.8em 0 0.5em; color: var(--text); font-family: var(--serif); font-weight: 400; font-size: 1.6rem; line-height: 1.15; }
.article-body .button-wrapper { margin: 2em 0; }
.article-body .button-wrapper a, .article-body a.button {
  display: inline-block; padding: 12px 24px; border: 1px solid var(--text); border-radius: 999px;
  color: var(--text); font-weight: 600; text-decoration: none;
}
.article-body .subscription-widget-wrap, .article-body .subscription-widget,
.article-body .install-substack-app-embed { display: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] > span { transform: none; transition: none; }
  .hero-copy { transition: none; }
  .tile-img img { transition: none; }
}
