:root {
  --bg: #000000;
  --text: #EDEDE8;
  --text-dim: #8E8E86;
  --rule: #1a1a17;
  --green: #2E7D4F;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'EB Garamond', serif;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

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

::selection { background: var(--green); color: #fff; }

a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

h1, h2 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
}

/* ---------- Nav ---------- */

.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 28px 24px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topnav a {
  color: var(--text);
  transition: opacity 0.25s ease;
  opacity: 0.65;
}

.topnav a:hover { opacity: 1; }

.topnav a.active { opacity: 1; }

/* ---------- Home ---------- */

.home-wrap {
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home-wrap + .site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

#dots-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
}

.home-name {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#name-canvas {
  display: block;
  max-width: 90vw;
}

.home-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.home-subtitle {
  margin-top: -10px;
  font-family: 'EB Garamond', serif;
  font-size: clamp(14px, 1.6vw, 17px);
  color: var(--text-dim);
  letter-spacing: 0.02em;
  text-align: center;
}

.linkedin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  margin-top: 6px;
  border: 1px solid var(--green);
  border-radius: 2px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(46, 125, 79, 0.08);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.linkedin-btn:hover {
  background: var(--green);
  color: #fff;
  box-shadow: 0 0 18px rgba(46, 125, 79, 0.45);
}

.linkedin-btn svg { flex-shrink: 0; }

/* ---------- Utility ---------- */

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

/* ---------- Shell ---------- */

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 120px 32px 100px;
}

.page-eyebrow {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hairline {
  border: none;
  border-top: 1px solid var(--rule);
  margin-bottom: 48px;
}

/* ---------- Rows ---------- */

.row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}

.row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.row-tile {
  width: 100%;
  aspect-ratio: 16/10;
  border: 1px solid var(--rule);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #04101f;
  padding: 18px;
}

.row-tile img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.row-body h2 { font-size: clamp(20px, 3vw, 28px); margin-bottom: 16px; line-height: 1.3; letter-spacing: 0.02em; }

.section-subheading {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 56px 0 28px;
  padding-top: 4px;
}

.row-body .tag {
  display: block;
  font-family: 'EB Garamond', serif;
  font-variant: small-caps;
  font-size: 15px;
  color: var(--text-dim);
  margin-top: 6px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.row-body p { font-size: 18px; line-height: 1.6; max-width: 600px; margin-bottom: 12px; }

.row-body p.dim { color: var(--text-dim); font-style: italic; }

.row-body a.inline-link {
  color: var(--green);
  border-bottom: 1px solid var(--green);
}

/* ---------- Contact ---------- */

.contact-text p {
  font-size: 19px;
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 26px;
}

.contact-text strong { color: var(--green); }

/* ---------- Essays index ---------- */

.essay-rotation-note {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 40px;
  margin-top: -16px;
}

.essay-list {
  display: flex;
  flex-direction: column;
}

.essay-entry {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
  transition: opacity 0.25s ease;
}

.essay-list .essay-entry:last-child { border-bottom: none; }

.essay-entry:hover { opacity: 0.75; }

.essay-entry h2 {
  font-size: clamp(19px, 2.6vw, 25px);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.essay-meta {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.essay-dek {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  max-width: 640px;
}

/* ---------- Essay article ---------- */

.essay-shell {
  max-width: 700px;
  margin: 0 auto;
  padding: 120px 32px 110px;
}

.essay-header {
  margin-bottom: 36px;
}

.essay-title {
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.essay-byline {
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  color: var(--text-dim);
}

.essay-byline .essay-author {
  color: var(--text);
  font-style: italic;
}

.essay-byline .dot-sep {
  margin: 0 8px;
  opacity: 0.5;
}

.essay-dedication {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.6;
  font-style: italic;
  color: var(--text-dim);
  border-left: 2px solid var(--green);
  padding-left: 16px;
}

.essay-body {
  font-size: 19px;
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.essay-body p {
  margin-bottom: 24px;
}

.essay-body a.inline-link,
.essay-footnotes a.inline-link {
  color: var(--green);
  border-bottom: 1px solid var(--green);
  text-decoration: none;
}

.essay-body h2 {
  font-size: 21px;
  letter-spacing: 0.02em;
  margin: 40px 0 16px;
  color: var(--text);
}

.essay-body h2:first-child { margin-top: 0; }

.essay-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 17px;
  color: var(--text-dim);
  margin-top: -10px;
  margin-bottom: 30px;
  line-height: 1.6;
}

.essay-authornote {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.essay-references li {
  font-family: 'EB Garamond', serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ---------- Slide figures (talk recap posts) ---------- */

.slide-figure {
  margin: 0 0 40px;
}

.slide-figure img {
  width: 100%;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.slide-figure figcaption {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
}

.slide-note {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  border-left: 2px solid var(--green);
  padding-left: 16px;
  word-break: break-word;
}

.transcription-flag {
  background: rgba(46, 125, 79, 0.25);
  color: var(--text);
  padding: 0 3px;
  border-radius: 2px;
}

.essay-references ol {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.essay-ps {
  font-size: 17px;
  color: var(--text-dim);
  border-top: 1px solid var(--rule);
  padding-top: 22px;
  margin-top: 8px;
}

.footnote-link {
  font-size: 0.78em;
  vertical-align: super;
  text-decoration: none;
  border-bottom: none !important;
}

.essay-footnotes {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.essay-footnotes ol {
  list-style: decimal;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.essay-footnotes li {
  font-family: 'EB Garamond', serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}

.essay-footnotes a.inline-link {
  word-break: break-all;
}

.essay-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 30px 0;
  width: 60px;
}

.essay-back {
  display: inline-block;
  margin-top: 50px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  border-bottom: 1px solid var(--green);
}

/* ---------- Engagement bar (like + comment count) ---------- */

.engagement-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  color: var(--text-dim);
  padding: 4px 0;
  transition: color 0.18s ease;
}

.like-btn:hover { color: var(--text); }

.like-btn svg {
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.8;
  transition: fill 0.18s ease, stroke 0.18s ease, transform 0.16s ease;
}

.like-btn:hover svg { stroke: var(--text); }

.like-btn.is-liked svg {
  fill: var(--green);
  stroke: var(--green);
}

.like-btn.is-liked { color: var(--green); }

.like-btn.bump svg { transform: scale(1.25); }

.like-count { font-weight: 600; }

.comment-count-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.18s ease;
}

.comment-count-label:hover { color: var(--text); }

.comment-count-label svg {
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1.8;
  transition: stroke 0.18s ease;
}

.comment-count-label:hover svg { stroke: var(--text); }

/* ---------- Comments ---------- */

.comments-section {
  margin-top: 56px;
  scroll-margin-top: 90px;
}

.comments-heading {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.comments-limited-notice {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--text-dim);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}

.comment-form input[type="text"],
.comment-form textarea {
  width: 100%;
  background: #0a0a08;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--text);
  font-family: 'EB Garamond', serif;
  font-size: 16px;
  padding: 11px 14px;
  transition: border-color 0.18s ease;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--green);
}

.comment-form input[type="text"]:disabled {
  opacity: 0.4;
}

.comment-form textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.comment-form-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.comment-name-field {
  flex: 1;
  min-width: 180px;
}

.anon-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.anon-toggle input { accent-color: var(--green); cursor: pointer; }

.comment-submit {
  align-self: flex-start;
  margin-top: 2px;
  padding: 10px 22px;
  border: 1px solid var(--green);
  border-radius: 2px;
  background: rgba(46, 125, 79, 0.08);
  color: var(--text);
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.comment-submit:hover {
  background: var(--green);
  color: #fff;
  box-shadow: 0 0 16px rgba(46, 125, 79, 0.4);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.comment-item {
  display: flex;
  gap: 14px;
}

.comment-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(46, 125, 79, 0.18);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--green);
}

.comment-body { flex: 1; min-width: 0; }

.comment-name {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
}

.comment-name .anon-tag {
  color: var(--text-dim);
  font-weight: 400;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

.comment-text {
  font-size: 16px;
  line-height: 1.6;
  margin-top: 4px;
  word-wrap: break-word;
}

.comment-list .comment-item.new .comment-text { color: var(--text); }

@media (max-width: 720px) {
  .essay-shell { padding: 100px 20px 90px; }
}

/* ---------- Subscribe modal ---------- */

.subscribe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
}

.subscribe-overlay.is-open { display: flex; }

.subscribe-modal {
  background: #0a0a08;
  border: 1px solid var(--rule);
  border-radius: 6px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 28px 26px;
  position: relative;
  box-shadow: 0 0 40px rgba(46, 125, 79, 0.18);
}

.subscribe-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.18s ease;
}

.subscribe-modal-close:hover { color: var(--text); }

.subscribe-modal h3 {
  font-size: 20px;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
  padding-right: 24px;
}

.subscribe-modal p.subscribe-copy {
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.subscribe-modal iframe {
  width: 100%;
  height: 480px;
  border: none;
  border-radius: 4px;
  background: #fff;
  display: block;
}

.subscribe-iframe-wrap {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 0 24px 60px;
  font-size: 13px;
  color: var(--text-dim);
}

@media (max-width: 720px) {
  .topnav { gap: 26px; font-size: 13px; padding: 22px 16px; }
  .row { grid-template-columns: 1fr; gap: 22px; }
  .shell { padding: 100px 20px 80px; }
}

@media (prefers-reduced-motion: reduce) {
  #dots-canvas { display: none; }
  #name-canvas { display: none; }
  .home-name .visually-hidden {
    position: static;
    width: auto; height: auto;
    margin: 0; padding: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: clamp(22px, 4.2vw, 44px);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 0 24px rgba(46, 125, 79, 0.35);
  }
}

/* ---------- Hashtag ---------- */

.page-hashtag {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #000000;
  user-select: none;
  pointer-events: none;
}
