@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/fonts/instrument-serif-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
:root {
  --bg: #070605;
  --ink: #f1eae0;
  --ink-2: rgba(241, 234, 224, 0.76);
  --ink-3: rgba(241, 234, 224, 0.62);
  --rule: rgba(241, 234, 224, 0.14);
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --gutter: clamp(20px, 3.2vw, 48px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* the sea from the home page, at the head of every essay */
.sea {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: min(58vh, 560px);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.6s;
  -webkit-mask-image: linear-gradient(#000 35%, transparent);
  mask-image: linear-gradient(#000 35%, transparent);
}
.sea.on { opacity: 0.9; }
.bar, .essay-page { position: relative; z-index: 1; }
.essay-head { text-shadow: 0 2px 28px rgba(0, 0, 0, 0.7); }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(60vmax 50vmax at 18% 6%, rgba(255, 110, 40, 0.13), transparent 60%),
    radial-gradient(55vmax 45vmax at 92% 40%, rgba(190, 30, 50, 0.09), transparent 60%),
    radial-gradient(42vmax 32vmax at 50% 100%, rgba(60, 70, 190, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; }
::selection { background: rgba(255, 140, 70, 0.35); color: #fff; }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.bar {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: calc(var(--gutter) * 0.75) var(--gutter);
  font-size: 13.5px;
}
/* the page opens the way the home page does: a line of light, then the words */
body::before {
  content: '';
  position: fixed;
  left: 0; right: 0; top: 38vh;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffd7b0 30%, #fff 50%, #ffd7b0 70%, transparent);
  box-shadow: 0 0 18px 2px rgba(255, 160, 90, 0.5);
  transform: scaleX(0);
  opacity: 0;
  pointer-events: none;
  animation: line 1.1s cubic-bezier(0.2, 0.7, 0.1, 1) both;
}
@keyframes line { 0% { transform: scaleX(0); opacity: 1; } 55% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.essay-page { animation: rise 1.2s cubic-bezier(0.2, 0.7, 0.1, 1) 0.35s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { body::before, .essay-page { animation: none; } }
.bar a { text-decoration: none; }
.bar__name { font-family: var(--serif); font-size: 20px; }
.bar__nav { display: flex; gap: clamp(16px, 2.2vw, 32px); }
.bar__nav a { color: var(--ink-2); }
.bar__nav a:hover { color: var(--ink); }

.essay-page { padding: clamp(56px, 12vh, 140px) var(--gutter) 96px; }
article { max-width: 40rem; margin: 0 auto; }
.essay-head time { font-size: 12px; color: var(--ink-2); }
.essay-head h1 {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 0.98;
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.claim { margin: 36px 0 0; display: grid; gap: 14px; padding: 20px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.claim div { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; }
.claim dt { font-size: 13px; color: var(--ink-3); padding-top: 3px; }
.claim dd { margin: 0; font-size: 16px; color: var(--ink-2); }

.prose { margin-top: 48px; overflow-wrap: anywhere; }
.essay-page { overflow-x: clip; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose pre { margin: 0 0 1.3em; }
.prose h2 { margin: 2.2em 0 0.6em; font-family: var(--serif); font-size: 34px; font-weight: 400; line-height: 1.1; }
.prose h3 { margin: 1.8em 0 0.6em; font-size: 19px; font-weight: 500; }
.prose a { text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.86em; background: rgba(237, 230, 220, 0.07); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { overflow-x: auto; padding: 18px 20px; background: rgba(237, 230, 220, 0.05); border-radius: 8px; font-size: 14px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 1px solid var(--ink-3); color: var(--ink-2); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 500; color: var(--ink-2); }
.prose img { max-width: 100%; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }

.essay-next { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.essay-next a { text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.essay-next a:last-child { text-align: right; }
.essay-next span { font-size: 12px; color: var(--ink-3); }
.essay-next b { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.1; text-wrap: balance; }
.essay-next a:hover b { color: #fff; }
.essay-foot { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.essay-foot a { text-decoration: none; }
.essay-foot a:hover { color: var(--ink); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .bar__nav a[href^="mailto"] { display: none; }
  .claim div { grid-template-columns: 1fr; gap: 2px; }
}
