:root {
  --bg: #070604;
  --bg-2: #0c0a06;
  --gold: #d4af37;
  --gold-soft: #e8c87a;
  --gold-bright: #f6e3a1;
  --gold-deep: #a8852a;
  --gold-deeper: #6e5618;
  --panel: rgba(212, 175, 55, 0.045);
  --panel-strong: rgba(212, 175, 55, 0.085);
  --border: rgba(212, 175, 55, 0.16);
  --border-strong: rgba(212, 175, 55, 0.28);
  --text: #efe5cc;
  --muted: #b9a878;
  --soft: #8c7c54;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* Atmosphere */
.atmos { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 520px; height: 520px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(246, 227, 161, 0.10) 0%,
    rgba(212, 175, 55, 0.07) 25%,
    rgba(212, 175, 55, 0.03) 50%,
    transparent 70%);
  filter: blur(30px);
  opacity: 0;
  transition: opacity 0.5s ease;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}
.cursor-glow.is-on { opacity: 1; }
@media (hover: none) { .cursor-glow { display: none; } }
.orb {
  position: absolute; width: 580px; height: 580px; border-radius: 999px;
  background: radial-gradient(circle, rgba(212,175,55,0.13), transparent 65%);
  filter: blur(40px);
  animation: drift 22s ease-in-out infinite alternate;
}
.orb.a { top: -180px; left: -120px; }
.orb.b { bottom: -200px; right: -160px; animation-duration: 28s; animation-delay: -5s; }
@keyframes drift {
  0% { transform: translate(0,0) scale(1); }
  50% { transform: translate(60px,-30px) scale(1.06); }
  100% { transform: translate(-40px,30px) scale(0.96); }
}
.grid-bg {
  position: fixed; inset: 0; pointer-events: none; opacity: 0.04; z-index: 0;
  background-image:
    linear-gradient(rgba(212,175,55,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,0.5) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 75%);
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
}

/* Layout */
.page { width: min(720px, calc(100% - 36px)); margin: 0 auto; position: relative; z-index: 2; }

/* Nav */
nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 22px;
  backdrop-filter: blur(14px);
  background: rgba(7,6,4,0.55);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-top: 22px;
  position: sticky; top: 12px; z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4), inset 0 1px 0 rgba(212,175,55,0.1);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.brand-mark { width: 28px; height: 28px; flex: 0 0 auto; }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 13px; padding: 9px 14px; border-radius: 999px; transition: 0.3s ease; letter-spacing: 0.02em; position: relative; }
.nav-links a:hover { color: var(--gold-soft); background: rgba(212,175,55,0.08); }
.nav-links a.active { color: var(--gold-soft); background: rgba(212,175,55,0.08); }

/* Article */
article.post { padding: 64px 0 24px; }

.post-header { text-align: center; margin-bottom: 48px; }
.back-link {
  display: inline-block;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 32px;
  transition: 0.3s ease;
}
.back-link:hover { color: var(--gold-soft); border-color: var(--border-strong); background: var(--panel); }

.post-meta {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 24px;
}
.post-meta .dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--gold-deep); }
.post-tag {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold);
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}

.post-header h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(40px, 6.5vw, 72px);
  line-height: 1.05; letter-spacing: -0.025em;
  margin: 0 0 20px;
  text-wrap: balance;
}
.post-header h1 em {
  font-style: italic;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede {
  max-width: 56ch; margin: 0 auto;
  color: var(--muted); font-style: italic;
  font-family: var(--serif); font-size: 22px; line-height: 1.45;
  text-wrap: pretty;
}
.flourish { display: block; margin: 36px auto 0; width: 120px; height: 16px; }

/* Body */
.post-body {
  font-family: var(--serif);
  font-size: 21px; line-height: 1.62;
  color: var(--text);
  font-weight: 400;
}
.post-body p { margin: 0 0 22px; text-wrap: pretty; }
.post-body p em { color: var(--gold-soft); font-style: italic; }
.post-body h2 {
  font-family: var(--serif); font-weight: 500; font-style: italic;
  font-size: 32px; line-height: 1.15; letter-spacing: -0.015em;
  margin: 56px 0 22px;
  color: var(--text);
  text-wrap: balance;
}
.post-body h2::before {
  content: ""; display: block; width: 36px; height: 1px;
  background: var(--gold); margin-bottom: 18px;
}
.dropcap {
  float: left;
  font-family: var(--serif);
  font-style: italic; font-weight: 500;
  font-size: 84px; line-height: 0.9;
  padding: 6px 14px 0 0;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.signoff {
  margin-top: 48px;
  font-family: var(--serif); font-style: italic;
  font-size: 22px; color: var(--gold-soft);
  text-align: center;
}
.signoff::before, .signoff::after {
  content: ""; display: inline-block;
  width: 36px; height: 1px; background: var(--gold-deep);
  vertical-align: middle; margin: 0 14px;
}

/* Footer */
.post-footer {
  margin-top: 56px; padding: 32px 0 64px;
  border-top: 1px solid var(--border);
}
.post-footer-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--soft);
}
.post-share a {
  color: var(--muted); transition: 0.3s ease; margin-left: 6px;
}
.post-share a:hover { color: var(--gold-soft); }

@media (max-width: 720px) {
  .container { padding: 0 18px; }
  .nav { padding: 12px 18px; }
  .brand span { font-size: 14px; }

  /* Nav: scroll instead of hide */
  .nav-links {
    display: flex !important;
    gap: 2px;
    overflow-x: auto;
    max-width: calc(100vw - 160px);
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a {
    font-size: 11.5px;
    padding: 7px 10px;
    flex: 0 0 auto;
    letter-spacing: 0.04em;
  }
  .nav-links a:not(.active) { display: inline-flex; }

  /* Article */
  article.post { padding: 40px 0 16px; }
  .post-header { margin-bottom: 32px; }
  .post-header h1 { font-size: clamp(34px, 9vw, 52px); line-height: 1.05; letter-spacing: -0.015em; }
  .post-meta-row { font-size: 11px; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .post-tag { font-size: 10px; padding: 4px 8px; }

  /* Body */
  .post-body { font-size: 17px; line-height: 1.65; }
  .post-body h2 { font-size: 24px; margin: 36px 0 16px; line-height: 1.2; }
  .post-body h3 { font-size: 19px; margin: 28px 0 12px; }
  .post-body p { margin: 0 0 18px; }
  .post-body blockquote { font-size: 17px; padding: 0 18px; }
  .post-body figure, .post-body img { margin: 24px 0; }
  .post-body pre, .post-body code { font-size: 12.5px; }
  .lede { font-size: 17px; line-height: 1.5; }
  .dropcap { font-size: 56px; padding: 4px 8px 0 0; }

  /* Share / footer */
  .post-share { flex-direction: column; gap: 10px; align-items: start; font-size: 11px; padding: 24px 0; }
  .post-nav { flex-direction: column; gap: 10px; }
  .post-nav a { width: 100%; }

  /* Disable cursor effects */
  .cursor-glow, .star-glow, .star-trail-svg { display: none !important; }
}

@media (max-width: 420px) {
  .container { padding: 0 14px; }
  .nav { padding: 10px 14px; }
  .brand span { display: none; }
  .nav-links { max-width: calc(100vw - 140px); }
  .nav-links a { font-size: 11px; padding: 6px 8px; }
  .post-body { font-size: 16px; }
  .post-body h2 { font-size: 22px; }
}
