:root {
  --tt: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 68px;
}

[data-theme="dark"] {
  --bg: #04040c;
  --bg2: #07071a;
  --card: #0d0d20;
  --card-h: #131330;
  --hero-txt: #f2f0f8;
  --txt: #ddd6c8;
  --txt2: #b0a894;
  --txt3: #7a7060;
  --txt4: #48443e;
  --teal: #10e8e8;
  --teal2: #3cffff;
  --tealD: #0a7878;
  --tealG: rgba(16, 232, 232, 0.16);
  --tealGl: rgba(16, 232, 232, 0.06);
  --gold: #e0be80;
  --gold2: #f5d898;
  --goldD: #886030;
  --goldG: rgba(224, 190, 128, 0.16);
  --goldGl: rgba(224, 190, 128, 0.06);
  --violet: #8844cc;
  --bTeal: rgba(16, 232, 232, 0.2);
  --bGold: rgba(224, 190, 128, 0.2);
  --bSubtle: rgba(255, 255, 255, 0.09);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  --shadowH: 0 28px 80px rgba(0, 0, 0, 0.9), 0 0 36px rgba(16, 232, 232, 0.14);
  --nebOp: 0.1;
}

[data-theme="light"] {
  --bg: #f2ece0;
  --bg2: #e8e0d2;
  --card: #ffffff;
  --card-h: #f6f0e8;
  --hero-txt: #0c0c1e;
  --txt: #1c160e;
  --txt2: #5c4c38;
  --txt3: #9a8878;
  --txt4: #c8b8a8;
  --teal: #0a8080;
  --teal2: #0aacac;
  --tealD: #065858;
  --tealG: rgba(10, 128, 128, 0.14);
  --tealGl: rgba(10, 128, 128, 0.07);
  --gold: #8a6028;
  --gold2: #aa7a38;
  --goldD: #5e4010;
  --goldG: rgba(138, 96, 40, 0.14);
  --goldGl: rgba(138, 96, 40, 0.07);
  --violet: #6622aa;
  --bTeal: rgba(10, 128, 128, 0.22);
  --bGold: rgba(138, 96, 40, 0.22);
  --bSubtle: rgba(0, 0, 0, 0.09);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadowH: 0 16px 48px rgba(0, 0, 0, 0.18), 0 0 24px rgba(10, 128, 128, 0.1);
  --nebOp: 0.04;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: "Raleway", sans-serif;
  font-weight: 400;
  line-height: 1.75;
  transition: background var(--tt), color var(--tt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  .cur-dot,
  .cur-ring,
  .cur-glow {
    display: block;
  }
}

@media (hover: none), (pointer: coarse) {
  body {
    cursor: auto;
  }

  .cur-dot,
  .cur-ring,
  .cur-glow {
    display: none !important;
  }
}

.cur-dot {
  position: fixed;
  z-index: 9999;
  width: 8px;
  height: 8px;
  pointer-events: none;
  background: var(--teal);
  border-radius: 50%;
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
  transition: width 0.18s, height 0.18s, background 0.2s;
}

.cur-ring {
  position: fixed;
  z-index: 9998;
  width: 34px;
  height: 34px;
  pointer-events: none;
  border: 1.5px solid var(--teal);
  border-radius: 50%;
  opacity: 0.55;
  transform: translate(-50%, -50%);
  transition: width 0.28s, height 0.28s, border-color 0.25s, opacity 0.25s;
}

.cur-glow {
  position: fixed;
  z-index: 1;
  width: 300px;
  height: 300px;
  pointer-events: none;
  background: radial-gradient(circle, var(--tealG) 0%, transparent 70%);
  border-radius: 50%;
  mix-blend-mode: screen;
  transform: translate(-50%, -50%);
}

#qCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

[data-theme="dark"] #qCanvas {
  opacity: 1;
}

[data-theme="light"] #qCanvas {
  opacity: 0.08;
}

.rpl {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  border: 1.5px solid var(--teal);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.65;
}

#mainNav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 24px;
  overflow: hidden;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}

#mainNav.scrolled {
  background: rgba(4, 4, 12, 0.94);
  border-bottom-color: var(--bSubtle);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="light"] #mainNav.scrolled {
  background: rgba(242, 236, 224, 0.96);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.nav-logo {
  z-index: 210;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.logo-img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  order: -1;
  object-fit: contain;
  padding: 2px;
  background: rgba(4, 4, 12, 0.48);
  border: 1px solid var(--bTeal);
  border-radius: 50%;
  filter: drop-shadow(0 0 18px rgba(16, 232, 232, 0.2));
}

.nav-wordmark {
  order: 0;
  color: var(--teal);
  font-family: "Cinzel", serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-shadow: 0 0 18px var(--tealG);
  transition: color var(--tt);
}

.nav-wordmark em {
  color: var(--gold);
  font-style: normal;
}

[data-theme="light"] .logo-img {
  background: rgba(255, 255, 255, 0.42);
  border-color: var(--bGold);
}

.nav-links {
  display: none;
  align-items: center;
  gap: clamp(16px, 2.2vw, 30px);
  list-style: none;
}

.nav-links a {
  position: relative;
  padding-bottom: 3px;
  color: var(--txt2);
  font-family: "Raleway", sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s;
}

.nav-links a::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  content: "";
  background: var(--teal);
  transition: width 0.3s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--txt);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  width: 100%;
}

.nav-right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
}

.ham-btn,
.theme-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.ham-btn {
  z-index: 210;
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  margin-right: 8px;
  cursor: pointer;
  background: var(--card);
  border: 1px solid var(--bSubtle);
  border-radius: 6px;
  transition: border-color 0.3s, background var(--tt);
}

.ham-btn:hover,
.ham-btn.open {
  border-color: var(--teal);
}

.ham-bar {
  width: 18px;
  height: 1.5px;
  background: var(--teal);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.3s, opacity 0.3s, background var(--tt);
}

.ham-btn.open .ham-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.ham-btn.open .ham-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.ham-btn.open .ham-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.theme-toggle {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  cursor: pointer;
  user-select: none;
  background: var(--card);
  border: 1.5px solid var(--bSubtle);
  border-radius: 40px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.3s, box-shadow 0.3s, background var(--tt);
}

.theme-toggle:hover {
  border-color: var(--teal);
  box-shadow: 0 0 18px var(--tealG);
}

.toggle-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.toggle-label {
  color: var(--txt2);
  font-family: "Raleway", sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1.5px solid var(--bTeal);
  border-radius: 9px;
  transition: all var(--tt);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--tealG);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

[data-theme="light"] .toggle-thumb {
  background: var(--gold);
  transform: translateX(15px);
}

[data-theme="light"] .toggle-track {
  border-color: var(--bGold);
}

.mob-menu {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 199;
  padding-top: var(--nav-h);
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  background: var(--bg2);
  border-bottom: 1px solid var(--bTeal);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(-100%);
  transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.mob-menu.open {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mob-menu ul {
  padding: 8px 0 16px;
  list-style: none;
}

.mob-menu li {
  border-bottom: 1px solid var(--bSubtle);
}

.mob-menu li:last-child {
  border-bottom: 0;
}

.mob-menu a {
  display: block;
  padding: 16px 28px;
  color: var(--txt2);
  font-family: "Raleway", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}

.mob-menu a:hover,
.mob-menu a:active,
.mob-menu a[aria-current="page"] {
  color: var(--teal);
  background: var(--tealGl);
}

.mob-overlay {
  position: fixed;
  inset: 0;
  z-index: 198;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.mob-overlay.open {
  display: block;
}

main,
footer {
  position: relative;
  z-index: 2;
}

.essays-hero {
  position: relative;
  display: grid;
  min-height: clamp(560px, 72svh, 780px);
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 5vw, 60px);
  align-items: end;
  padding: calc(var(--nav-h) + 72px) clamp(20px, 6vw, 72px) clamp(42px, 7vw, 86px);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 24%, rgba(136, 68, 204, 0.16), transparent 36%),
    radial-gradient(circle at 82% 44%, rgba(16, 232, 232, 0.12), transparent 30%),
    linear-gradient(180deg, transparent 0%, rgba(4, 4, 12, 0.82) 82%, rgba(4, 4, 12, 0.96) 100%);
}

[data-theme="light"] .essays-hero {
  background:
    radial-gradient(circle at 18% 24%, rgba(102, 34, 170, 0.08), transparent 36%),
    radial-gradient(circle at 82% 44%, rgba(10, 128, 128, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(242, 236, 224, 0.86) 0%, rgba(242, 236, 224, 0.97) 100%);
}

.neb {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(70px);
  opacity: var(--nebOp);
  animation: nebB 14s ease-in-out infinite;
}

.neb1 {
  top: -80px;
  left: -120px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #6b35b8, transparent);
}

.neb2 {
  top: 16%;
  right: -110px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #0ec4c4, transparent);
  animation-delay: 5s;
}

.neb3 {
  bottom: 0;
  left: 28%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #d4b070, transparent);
  animation-delay: 9s;
}

@keyframes nebB {
  0%,
  100% {
    transform: scale(1) translate(0, 0);
  }

  50% {
    transform: scale(1.12) translate(15px, -15px);
  }
}

.hero-copy,
.feed-panel,
.section-head,
.essay-grid,
.feed-error,
.noscript-note {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 920px;
}

.eyebrow {
  display: block;
  margin-bottom: 16px;
  color: var(--teal);
  font-family: "Raleway", sans-serif;
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 500;
  letter-spacing: clamp(0.3em, 4vw, 0.52em);
  text-transform: uppercase;
}

.hero-copy h1 {
  color: var(--hero-txt);
  font-family: "Cinzel", serif;
  font-size: clamp(44px, 10vw, 112px);
  font-weight: 700;
  letter-spacing: clamp(0.08em, 2.4vw, 0.16em);
  line-height: 0.98;
  text-shadow: 0 0 45px var(--tealG), 0 0 90px rgba(16, 232, 232, 0.15);
}

.hero-copy h1 span {
  display: block;
  color: var(--teal);
}

.hero-copy h1 em {
  display: block;
  color: var(--gold);
  font-style: normal;
  text-shadow: 0 0 45px var(--goldG);
}

.hero-line {
  max-width: 720px;
  margin-top: clamp(22px, 4vw, 34px);
  color: var(--txt2);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(19px, 3.2vw, 30px);
  font-style: italic;
  font-weight: 300;
  line-height: 1.55;
}

.feed-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 960px;
  padding: clamp(18px, 3vw, 26px);
  background: rgba(13, 13, 32, 0.72);
  border: 1px solid var(--bSubtle);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-theme="light"] .feed-panel {
  background: rgba(255, 255, 255, 0.78);
}

.feed-kicker,
.feed-status,
.substack-link,
.card-date,
.card-source,
.card-cta,
.foot-tag,
.foot-copy {
  font-family: "Raleway", sans-serif;
}

.feed-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.feed-status {
  color: var(--txt3);
  font-size: clamp(11px, 2vw, 13px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.substack-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 13px 18px;
  color: var(--bg);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-decoration: none;
  text-transform: uppercase;
  background: var(--teal);
  box-shadow: 0 6px 28px rgba(16, 232, 232, 0.28);
  transition: transform 0.3s, box-shadow 0.3s;
}

.substack-link:hover {
  box-shadow: 0 14px 44px rgba(16, 232, 232, 0.42);
  transform: translateY(-3px);
}

.essays-section {
  position: relative;
  padding: clamp(46px, 7vw, 90px) clamp(20px, 6vw, 72px) clamp(70px, 10vw, 130px);
  background: linear-gradient(90deg, rgba(4, 4, 12, 0.58) 0%, rgba(4, 4, 12, 0.82) 18%, rgba(4, 4, 12, 0.82) 82%, rgba(4, 4, 12, 0.58) 100%);
  border-top: 1px solid var(--bSubtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="light"] .essays-section {
  background: var(--bg);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: 1180px;
  gap: 20px;
  margin: 0 auto clamp(30px, 5vw, 54px);
}

.section-head h2 {
  color: var(--txt);
  font-family: "Cinzel", serif;
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.07em;
}

.section-head p {
  max-width: 310px;
  color: var(--txt3);
  font-size: 12px;
  letter-spacing: 0.14em;
  line-height: 1.8;
  text-transform: uppercase;
}

.essay-grid {
  display: grid;
  max-width: 1180px;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 0 auto;
}

.essay-card {
  position: relative;
  display: grid;
  min-height: 100%;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--bSubtle);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.4s, box-shadow 0.4s;
}

.essay-card::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(135deg, var(--tealGl), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
}

.essay-card:hover {
  border-color: var(--tealD);
  box-shadow: var(--shadowH);
  transform: translateY(-5px);
}

.essay-card:hover::before {
  opacity: 1;
}

.essay-thumb {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 20%, var(--tealGl), transparent 36%),
    radial-gradient(circle at 78% 70%, var(--goldGl), transparent 36%),
    var(--card-h);
}

.essay-thumb img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.08) brightness(0.72);
  transform: scale(1.02);
  transition: transform 0.7s ease, filter 0.7s ease;
}

.essay-card:hover .essay-thumb img {
  filter: saturate(1) contrast(1.1) brightness(0.88);
  transform: scale(1.07);
}

.essay-thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, transparent 0%, rgba(4, 4, 12, 0.68) 100%),
    linear-gradient(135deg, rgba(16, 232, 232, 0.12), transparent 48%);
}

[data-theme="light"] .essay-thumb::after {
  background: linear-gradient(180deg, transparent 0%, rgba(242, 236, 224, 0.62) 100%);
}

.thumb-placeholder {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 28%, rgba(16, 232, 232, 0.16), transparent 34%),
    radial-gradient(circle at 76% 70%, rgba(224, 190, 128, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(13, 13, 32, 0.94), rgba(19, 19, 48, 0.9));
}

.thumb-placeholder::before,
.thumb-placeholder::after {
  position: absolute;
  content: "";
}

.thumb-placeholder::before {
  inset: 18%;
  border: 1px solid var(--bTeal);
  border-radius: 50%;
  opacity: 0.54;
  box-shadow: 0 0 34px rgba(16, 232, 232, 0.12);
}

.thumb-placeholder::after {
  top: 50%;
  left: 50%;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: translate(-50%, -50%) rotate(-24deg);
  opacity: 0.58;
}

.card-body {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 36px) clamp(20px, 3.5vw, 34px);
}

.featured .card-body {
  min-height: 330px;
}

.card-date {
  display: block;
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.essay-card h3 {
  margin-bottom: 14px;
  color: var(--txt);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(23px, 4.8vw, 36px);
  font-weight: 500;
  line-height: 1.18;
  transition: color 0.3s;
}

.essay-card:not(.featured) h3 {
  font-size: clamp(19px, 3.2vw, 26px);
  line-height: 1.28;
}

.essay-card:hover h3 {
  color: var(--gold2);
}

.card-excerpt {
  color: var(--txt2);
  font-size: clamp(12.5px, 2vw, 14px);
  line-height: 1.75;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
}

.card-source,
.card-cta {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.card-source {
  color: var(--txt3);
}

.card-cta {
  color: var(--goldD);
  transition: color 0.3s, transform 0.3s;
}

.essay-card:hover .card-cta {
  color: var(--teal);
  transform: translateX(4px);
}

.skeleton {
  pointer-events: none;
}

.skeleton .thumb-placeholder,
.skeleton .card-body span,
.skeleton .card-body h3,
.skeleton .card-body p,
.skeleton .card-body div {
  position: relative;
  overflow: hidden;
}

.skeleton .card-body span,
.skeleton .card-body h3,
.skeleton .card-body p,
.skeleton .card-body div {
  display: block;
  background: rgba(255, 255, 255, 0.08);
}

.skeleton .card-body span {
  width: 130px;
  height: 10px;
  margin-bottom: 18px;
}

.skeleton .card-body h3 {
  width: 78%;
  height: 34px;
  margin-bottom: 18px;
}

.skeleton .card-body p {
  width: 100%;
  height: 74px;
}

.skeleton .card-body div {
  width: 160px;
  height: 10px;
  margin-top: 34px;
}

.skeleton .thumb-placeholder::before,
.skeleton .card-body span::after,
.skeleton .card-body h3::after,
.skeleton .card-body p::after,
.skeleton .card-body div::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.feed-error,
.noscript-note {
  max-width: 780px;
  margin: 28px auto 0;
  padding: 22px;
  color: var(--txt2);
  background: var(--card);
  border: 1px solid var(--bGold);
}

.feed-error p,
.noscript-note {
  font-family: "Cormorant Garamond", serif;
  font-size: 19px;
}

.feed-error a,
.noscript-note a {
  display: inline-flex;
  margin-top: 12px;
  color: var(--teal);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.rd1 {
  transition-delay: 0.1s;
}

.rd2 {
  transition-delay: 0.2s;
}

.rd3 {
  transition-delay: 0.3s;
}

.rd4 {
  transition-delay: 0.4s;
}

footer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: clamp(36px, 5vw, 56px) clamp(20px, 5vw, 56px);
  text-align: center;
  background: rgba(7, 7, 26, 0.9);
  border-top: 1px solid var(--bSubtle);
}

[data-theme="light"] footer {
  background: var(--bg2);
}

.foot-q {
  color: var(--txt3);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(13px, 2.5vw, 15px);
  font-style: italic;
  line-height: 1.8;
}

.foot-q cite {
  display: block;
  margin-top: 8px;
  color: var(--txt4);
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.18em;
}

.foot-brand {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-family: "Cinzel", serif;
  font-size: 14px;
  letter-spacing: 0.32em;
}

.foot-tag {
  color: var(--txt3);
  font-size: clamp(8px, 2vw, 10px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.foot-social,
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.foot-social {
  gap: 20px;
  margin-top: 14px;
}

.foot-links {
  gap: 16px;
}

.foot-social a,
.foot-links a {
  color: var(--txt3);
  font-family: "Raleway", sans-serif;
  font-size: clamp(9px, 2vw, 11px);
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.3s;
}

.foot-social a:hover,
.foot-links a:hover {
  color: var(--teal);
}

.foot-copy {
  padding-top: 22px;
  color: var(--txt4);
  font-size: clamp(8px, 2vw, 10px);
  letter-spacing: 0.2em;
  border-top: 1px solid var(--bSubtle);
}

@media (min-width: 768px) {
  #mainNav {
    padding: 0 48px;
    overflow: visible;
  }

  .nav-links {
    display: flex !important;
  }

  .ham-btn {
    display: none !important;
  }

  .essays-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.46fr);
  }

  .feed-panel {
    align-self: end;
    flex-direction: column;
    align-items: flex-start;
  }

  .essay-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .essay-card.featured {
    grid-column: span 2;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
  }

  .featured .essay-thumb,
  .featured .essay-thumb img,
  .featured .thumb-placeholder {
    min-height: 100%;
  }

  footer {
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    text-align: left;
  }

  .foot-center {
    text-align: center;
  }

  .foot-links {
    align-items: flex-end;
    justify-content: flex-end;
    flex-direction: column;
    gap: 12px;
  }

  .foot-copy {
    grid-column: 1 / -1;
    text-align: center;
  }
}

@media (min-width: 1040px) {
  #mainNav {
    padding: 0 64px;
  }

  .essay-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .essay-card.featured {
    grid-column: span 2;
  }
}

@media (max-width: 767px) {
  .nav-links {
    display: none !important;
  }

  .essays-hero {
    align-items: start;
  }

  .feed-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-head p {
    max-width: none;
  }
}

@media (max-width: 520px) {
  #mainNav {
    padding: 0 16px;
  }

  .nav-logo {
    gap: 8px;
  }

  .logo-img {
    width: 34px;
    height: 34px;
  }

  .nav-wordmark {
    font-size: 13px;
    letter-spacing: 0.2em;
  }

  .substack-link {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .logo-img {
    width: 31px;
    height: 31px;
  }

  .nav-wordmark {
    font-size: 12px;
    letter-spacing: 0.17em;
  }

  .nav-right {
    gap: 6px;
  }

  .ham-btn {
    width: 36px;
    height: 36px;
    margin-right: 4px;
  }

  .toggle-label {
    display: none;
  }

  .theme-toggle {
    padding: 7px 10px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }
}
