@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --ink: #d7e3ff;
  --muted: #9fb2d9;
  --deep: #05070d;
  --night-1: #050a18;
  --night-2: #0a1530;
  --night-3: #142446;
  --glass: rgba(120, 160, 220, 0.12);
  --border: rgba(160, 190, 240, 0.22);
  --accent: #8fb0ff;
  --accent-2: #6bd4ff;
  --shadow: rgba(10, 16, 30, 0.55);
  --content-max: 1100px;
  --page-bg: #040813;
  --gallery-bg: #000000;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page-bg);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.28) 1px, transparent 0),
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 0);
  background-size: 120px 120px, 180px 180px;
  background-position: 0 0, 60px 60px;
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}

body.gallery {
  background: var(--gallery-bg);
}

.essay-page,
.essay-page .essay-content,
.essay-page .essay-hero {
  font-family: "Verdana", "Geneva", "Tahoma", sans-serif;
}

body.gallery::before {
  display: none;
}

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

.accent-link {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(143, 176, 255, 0.75);
}

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

header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  background: rgba(6, 10, 22, 0.7);
  border-bottom: 1px solid rgba(120, 160, 220, 0.12);
  z-index: 10;
}

.navbar {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  font-family: "Libre Baskerville", "Times New Roman", serif;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  font-size: 0.95rem;
  color: var(--muted);
}

nav a {
  position: relative;
  padding-bottom: 4px;
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.35s ease;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 80px 24px 96px;
}

.hero {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.hero h1 {
  font-family: "Libre Baskerville", "Times New Roman", serif;
  font-size: clamp(1.9rem, 2.5vw, 2.85rem);
  line-height: 1.15;
  margin: 19px 0 18px;
}

.essay-title {
  font-size: clamp(1.08rem, 1.4vw, 1.32rem);
  letter-spacing: 0.01em;
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-intro {
  margin-top: 11px;
}

.hero .glass-card {
  margin-top: calc(0.85rem + 24px);
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
  box-shadow: 0 20px 40px var(--shadow);
}

.hero-photo {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(160, 190, 240, 0.2);
  box-shadow: 0 24px 50px var(--shadow);
  background: rgba(10, 16, 30, 0.35);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.glass-card > :first-child {
  margin-top: 0;
}

.glass-card > :last-child {
  margin-bottom: 0;
}

.glass-card h2,
.glass-card h3 {
  margin: 0 0 12px;
}

.glass-card p {
  margin: 0 0 12px;
}

.section {
  margin-top: 56px;
}

.section h2 {
  font-size: 1.4rem;
  margin: 0 0 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.split {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.tag {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(120, 160, 220, 0.18);
  border: 1px solid rgba(160, 190, 240, 0.3);
  font-size: 0.85rem;
  line-height: 1;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.list a {
  display: block;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(12, 18, 38, 0.65);
  border: 1px solid rgba(100, 130, 190, 0.2);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.list a:hover {
  transform: translateY(-3px);
  border-color: rgba(140, 180, 255, 0.6);
}

.essay-hero {
  max-width: 720px;
  margin: 0 auto;
}

.essay-content {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.84;
}

.essay-content h1,
.essay-content h2,
.essay-content h3,
.essay-content h4 {
  font-family: "Libre Baskerville", "Times New Roman", serif;
  margin: 1.6rem 0 0.6rem;
}

.essay-content h2 {
  font-size: clamp(1.1rem, 1.35vw, 1.3rem);
}

.essay-content p {
  margin: 0 0 1rem;
}

.essay-content img,
.essay-content video,
.essay-content iframe {
  max-width: 100%;
  border-radius: 12px;
}

.essay-subtitle:empty {
  display: none;
}

.essay-content figure {
  margin: 1.6rem 0;
}

.essay-content figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.6rem;
}

.essay-content blockquote {
  margin: 1.6rem 0;
  padding-left: 1rem;
  border-left: 2px solid rgba(140, 180, 255, 0.45);
  color: rgba(215, 227, 255, 0.85);
}

.essay-content ul,
.essay-content ol {
  margin: 0 0 1.2rem 1.2rem;
  padding-left: 0;
}

/* Hide common Substack UI cruft when raw HTML is pasted */
.essay-content .subscribe-widget,
.essay-content .subscription-widget,
.essay-content .subscription-widget-wrap,
.essay-content .subscribe-button,
.essay-content .share-wrapper,
.essay-content .post-footer,
.essay-content .post-cta,
.essay-content .like-button,
.essay-content .button,
.essay-content .captioned-button,
.essay-content .post-actions,
.essay-content .comment-footer,
.essay-content .comment-button,
.essay-content .post-share,
.essay-content .post-share-buttons,
.essay-content .social-share,
.essay-content .social-share-buttons,
.essay-content .newsletter-signup,
.essay-content .upgrade-cta,
.essay-content .paywall-banner,
.essay-content .paywall-container,
.essay-content .paywall,
.essay-content .post-bottom,
.essay-content .footer-signup,
.essay-content .signup-prompt {
  display: none !important;
}

.footer {
  max-width: var(--content-max);
  margin: 0 auto 32px;
  padding: 0 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.9s ease forwards;
}

.reveal.delay-1 { animation-delay: 0.1s; }
.reveal.delay-2 { animation-delay: 0.2s; }
.reveal.delay-3 { animation-delay: 0.3s; }
.reveal.delay-4 { animation-delay: 0.4s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery main {
  max-width: 1280px;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}

.gallery-title {
  font-family: "Libre Baskerville", "Times New Roman", serif;
  font-size: clamp(1.74rem, 2.35vw, 2.5rem);
  margin: 10px 0 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.gallery-grid figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.9) contrast(1.1);
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.gallery-grid figure:hover img {
  transform: scale(1.04);
  opacity: 0.92;
}

.caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 720px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  main {
    padding-top: 56px;
  }
}
