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

:root {
  --bg: #080808;
  --fg: #f0ece0;
  --fg-mid: rgba(240,236,224,0.55);
  --fg-mid-bright: rgba(240,236,224,0.78);
  --fg-dim: rgba(240,236,224,0.2);
  --accent: #ff3cac;
  --border: rgba(240,236,224,0.1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Space Mono", monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

canvas#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site {
  position: relative;
  z-index: 1;
}

/* ─ Header ─────────────────────────────────────────── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 3rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8,8,8,0.6);
}

/* iOS can be finicky with sticky + backdrop-filter hit-testing */
.site-header,
.site-header * {
  pointer-events: auto;
}

.site-logo {
  font-family: "bebas-kai", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-decoration: none;
}

.site-logo span {
  color: var(--hero-kicker-color, var(--accent));
  font-style: italic;
}

.site-nav {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.site-nav a {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.site-nav a:hover { color: var(--fg); }

/* ─ Hero ────────────────────────────────────────────── */
.hero {
  padding: 9rem 3rem 7rem;
  max-width: 1000px;
}

.hero--small {
  padding: 5rem 3rem 4rem;
}

.hero-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hero-kicker-color, var(--accent));
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-kicker::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--hero-kicker-color, var(--accent));
}

.hero h1 {
  font-family: "birch-std", serif;
  font-size: clamp(3.2rem, 9vw, 8rem);
  line-height: 1.0;
  font-weight: 400;
  margin-bottom: 2rem;
  color: var(--fg);
}

.hero h1 em {
  font-style: italic;
  color: var(--fg-mid);
}

.hero-desc {
  font-size: 0.82rem;
  line-height: 2;
  color: var(--fg-mid);
  max-width: 420px;
  margin-bottom: 3.5rem;
}

/* ─ Subscribe form ───────────────────────────────────── */
.subscribe-row,
.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  max-width: 420px;
}

.subscribe-form-fields {
  display: flex;
  flex: 1;
  min-width: 0;
}

.subscribe-form-success {
  display: none;
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  color: var(--fg-mid);
}
.subscribe-form.success .subscribe-form-fields { display: none; }
.subscribe-form.success .subscribe-form-success { display: block; }
.subscribe-form.success .subscribe-form-error { display: none; }

.subscribe-form-error {
  width: 100%;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--hero-kicker-color, var(--accent));
}
.subscribe-form-error:empty { display: none; }

.subscribe-row input[type=email],
.subscribe-form input[type=email] {
  flex: 1;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--fg);
  padding: 0.9rem 1.2rem;
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.subscribe-row input[type=email]:focus,
.subscribe-form input[type=email]:focus {
  border-color: var(--hero-kicker-color, rgba(240,236,224,0.35));
}

.subscribe-row input[type=email]::placeholder,
.subscribe-form input[type=email]::placeholder {
  color: var(--fg-dim);
}

.subscribe-row button,
.subscribe-form button {
  background: var(--hero-kicker-color, var(--accent));
  color: var(--bg);
  border: none;
  padding: 0.9rem 1.4rem;
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s;
}

.subscribe-row button:hover,
.subscribe-form button:hover {
  filter: brightness(1.12);
}

/* ─ Divider ─────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  padding: 0 3rem;
  gap: 1.5rem;
  color: var(--fg-dim);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 3.5rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─ Posts grid ───────────────────────────────────────── */
.posts-section {
  padding: 0 3rem 8rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
}

.post-card {
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.post-card:hover {
  background: rgba(240,236,224,0.03);
}

.post-tag {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hero-kicker-color, var(--accent));
  margin-bottom: 1.2rem;
  text-decoration: none;
  display: block;
}

.post-title {
  font-family: "birch-std", serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--fg);
  margin-bottom: 1rem;
}

.post-excerpt {
  font-size: 0.77rem;
  line-height: 1.85;
  color: var(--fg-mid);
  margin-bottom: 2rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--fg-mid);
}

.post-meta::before {
  content: '';
  display: block;
  width: 14px;
  height: 1px;
  background: var(--fg-dim);
}

/* ─ Feature post ─────────────────────────────────────── */
.feature-post {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-right: none !important;
}

.feature-post .post-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.post-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.post-title-link:hover {
  color: var(--hero-kicker-color, var(--accent));
}

.feature-post-body {
  padding: 3rem;
  border-right: 1px solid var(--border);
}

.feature-post-aside {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.feature-num {
  font-family: "Space Mono", monospace;
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(240,236,224,0.05);
  margin-bottom: auto;
}

.feature-read-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.feature-read-link:hover {
  color: var(--hero-kicker-color, var(--accent));
  border-color: var(--hero-kicker-color, var(--accent));
}

/* ─ Single post ───────────────────────────────────────── */
.post-full {
  max-width: 720px;
  margin: 0 auto;
  padding: 6rem 3rem 8rem;
}

.post-full-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2.5rem;
}

.post-full-title {
  font-family: "birch-std", serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.08;
  margin: 1rem 0 1.5rem;
}

.post-full-meta {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--fg-mid);
  display: flex;
  gap: 0.75rem;
}

.post-full-image {
  margin: 0 0 3rem;
}

.post-full-image img {
  width: 100%;
  display: block;
}

/* Ghost content styles */
.gh-content {
  font-size: 0.9rem;
  line-height: 1.85;
  color: var(--fg-mid-bright);
}

/* Tag / small heroes use body serif instead of Birch */
.hero--small h1 {
  font-family: "Space Mono", monospace;
}

.gh-content h2 {
  font-family: "Space Mono", monospace;
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--fg);
  margin: 3rem 0 1rem;
}

.gh-content h3 {
  font-family: "Space Mono", monospace;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--fg);
  margin: 2.5rem 0 0.75rem;
}

.gh-content p { margin-bottom: 1.5rem; }

.gh-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.gh-content a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.gh-content a:hover { color: var(--hero-kicker-color, var(--accent)); }

.gh-content blockquote {
  border-left: 2px solid var(--hero-kicker-color, var(--accent));
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-family: "Space Mono", monospace;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--fg);
}

.gh-content img {
  width: 100%;
  margin: 2rem 0;
}

.gh-content pre {
  background: rgba(240,236,224,0.04);
  border: 1px solid var(--border);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-size: 0.8rem;
}

.gh-content code {
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  color: var(--hero-kicker-color, var(--accent));
}

/* ─ Author card ──────────────────────────────────────── */
.post-full-footer {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.author-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.author-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(30%);
}

.author-name {
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
}

.author-bio {
  font-size: 0.78rem;
  color: var(--fg-mid);
  line-height: 1.6;
}

.post-subscribe {
  padding-top: 2rem;
}

.post-subscribe-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mid);
  margin-bottom: 1.25rem;
}

/* ─ Pagination ───────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 3rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pagination a {
  color: var(--fg-mid);
  text-decoration: none;
  transition: color 0.2s;
}

.pagination a:hover { color: var(--fg); }

.pagination .page-number {
  color: var(--fg-mid);
}

/* ─ Footer ───────────────────────────────────────────── */
.site-footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
}

.footer-logo {
  font-family: "bebas-kai", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1.05rem;
  color: var(--fg-dim);
  text-decoration: none;
}

/* ─ Spotify corner widget ────────────────────────────── */
.spotify-widget {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  font-size: 0.7rem;
}

.spotify-widget-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.spotify-widget-toggle {
  display: block;
  padding: 0.5rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg-mid);
  font-family: "Space Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 999px;
  transition: border-color 0.2s, color 0.2s;
}

.spotify-widget-toggle:hover {
  color: var(--fg);
  border-color: rgba(240,236,224,0.25);
}

.spotify-widget-panel {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  right: 0;
  width: 360px;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.spotify-widget-check:checked ~ .spotify-widget-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.spotify-widget-panel iframe {
  display: block;
  width: 100%;
  height: 152px;
  border-radius: 8px;
  border: 0;
}

.spotify-widget-open {
  display: block;
  margin-top: 0.5rem;
  color: var(--fg-dim);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.spotify-widget-open:hover {
  color: var(--hero-kicker-color, var(--accent));
}

/* ─ Mobile ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .posts-grid { grid-template-columns: 1fr; }
  .feature-post { grid-template-columns: 1fr; }
  .feature-post-aside { display: none; }
}

@media (max-width: 768px) {
  .site-header { padding: 1.25rem 1.5rem; }
  .hero { padding: 5rem 1.5rem 4rem; }
  .posts-section { padding: 0 1.5rem 5rem; }
  .divider { padding: 0 1.5rem; }
  .site-footer { padding: 1.5rem; flex-direction: column; gap: 1rem; text-align: center; }
  .post-full { padding: 4rem 1.5rem 5rem; }
  .feature-post-body { padding: 2rem 1.5rem; }
  .site-nav { gap: 1.5rem; }
}

/* ─ Ghost card widths (required) ─────────────────────── */
.gh-content .kg-width-wide {
  width: 85vw;
  max-width: 1200px;
  margin-left: calc(50% - 42.5vw);
  margin-right: calc(50% - 42.5vw);
}
.gh-content .kg-width-full {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}
.kg-card { margin: 2rem 0; }
.kg-image-card img, .kg-image { width: 100%; height: auto; display: block; }
.kg-gallery-container { display: flex; flex-direction: column; gap: 0.5rem; }
.kg-gallery-row { display: flex; gap: 0.5rem; }
.kg-gallery-image { flex: 1; min-width: 0; }
.kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kg-video-card video { width: 100%; display: block; }
.kg-embed-card { display: flex; justify-content: center; }
.kg-embed-card iframe { max-width: 100%; }
.kg-bookmark-card { border: 1px solid var(--border); }
.kg-bookmark-container { display: flex; text-decoration: none; color: inherit; min-height: 148px; }
.kg-bookmark-content { flex: 1; padding: 1.25rem; }
.kg-bookmark-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.5rem; color: var(--fg); }
.kg-bookmark-description { font-size: 0.78rem; color: var(--fg-mid); line-height: 1.5; }
.kg-bookmark-metadata { margin-top: 0.75rem; font-size: 0.68rem; color: var(--fg-dim); display: flex; gap: 0.5rem; }
.kg-bookmark-thumbnail { width: 200px; flex-shrink: 0; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kg-callout-card { display: flex; gap: 1rem; padding: 1.25rem; border: 1px solid var(--border); background: rgba(240,236,224,0.03); margin: 2rem 0; }
.kg-callout-emoji { font-size: 1.25rem; flex-shrink: 0; }
.kg-callout-text { font-size: 0.9rem; line-height: 1.7; color: var(--fg-mid); }
.kg-toggle-card { border: 1px solid var(--border); padding: 1.25rem; margin: 1.5rem 0; }
.kg-toggle-heading { display: flex; justify-content: space-between; cursor: pointer; }
.kg-toggle-heading-text { font-weight: 700; color: var(--fg); }
.kg-toggle-content { margin-top: 1rem; font-size: 0.9rem; color: var(--fg-mid); line-height: 1.7; }
.kg-audio-card { border: 1px solid var(--border); padding: 1.25rem; }
.kg-audio-player { width: 100%; }
.kg-product-card { border: 1px solid var(--border); padding: 1.5rem; }
.kg-product-card-image { width: 100%; margin-bottom: 1rem; }
.kg-product-card-title { font-family: "Space Mono", monospace; font-size: 1.3rem; color: var(--fg); margin-bottom: 0.5rem; }
.kg-product-card-description { font-size: 0.82rem; color: var(--fg-mid); line-height: 1.6; }
.kg-product-card-button { display: inline-block; margin-top: 1rem; padding: 0.7rem 1.4rem; background: var(--fg); color: var(--bg); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; }
.kg-header-card { padding: 4rem 3rem; text-align: center; background: rgba(240,236,224,0.03); }
.kg-header-card h2 { font-family: "Space Mono", monospace; font-size: 2.5rem; font-weight: 400; color: var(--fg); }
.kg-header-card p { margin-top: 1rem; color: var(--fg-mid); font-size: 0.9rem; }
.kg-file-card { border: 1px solid var(--border); }
.kg-file-card-container { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; text-decoration: none; color: inherit; }
.kg-file-card-contents { flex: 1; }
.kg-file-card-title { font-size: 0.9rem; color: var(--fg); }
.kg-file-card-caption, .kg-file-card-metadata { font-size: 0.72rem; color: var(--fg-dim); }
.kg-button-card { text-align: center; margin: 2rem 0; }
.kg-btn { display: inline-block; padding: 0.85rem 2rem; background: var(--fg); color: var(--bg); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; transition: background 0.2s; }
.kg-btn:hover { background: #e0dcd0; }
.kg-btn-accent { background: var(--hero-kicker-color, var(--accent)); color: #fff; }
figcaption { font-size: 0.72rem; color: var(--fg-dim); text-align: center; margin-top: 0.6rem; letter-spacing: 0.04em; }

/* ─ Post header extras ───────────────────────────────── */
.post-full-tags { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.post-tag--secondary { color: var(--fg-dim); }
.post-full-excerpt { font-family: "Space Mono", monospace; font-size: 1.2rem; font-style: italic; color: var(--fg-mid); line-height: 1.5; margin: 1rem 0 1.5rem; }
.post-author-link { color: var(--fg-mid); text-decoration: none; transition: color 0.2s; }
.post-author-link:hover { color: var(--fg); }
.author-name { font-family: "Space Mono", monospace; font-size: 1.1rem; color: var(--fg); margin-bottom: 0.25rem; text-decoration: none; display: block; }
