/* Lune Synth blog — matches the main lunesynth.com dark design system.
   Header markup, CSS, and JS are copied from the main site for parity. */
:root {
  --font-mono: "Roboto Mono", monospace;
  --font-sans: "Plus Jakarta Sans", sans-serif;
  --bg: #000000;
  --bg-deep: #000000;
  --grid: rgba(164, 123, 255, 0.08);
  --blue: #64a8ff;
  --purple: #a47bff;
  --red: #ff5d87;
  --text: #edf5ff;
  --muted: #a6bad7;
  --card: rgba(8, 17, 34, 0.72);
  --glass: rgba(16, 28, 54, 0.7);
  --line: rgba(164, 123, 255, 0.2);
  --glow: 0 18px 50px rgba(4, 10, 24, 0.45), 0 0 26px rgba(100, 168, 255, 0.08), 0 0 26px rgba(164, 123, 255, 0.08), 0 0 26px rgba(255, 93, 135, 0.08);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(100, 168, 255, 0.11), transparent 55%),
    radial-gradient(1000px 700px at 85% 10%, rgba(164, 123, 255, 0.11), transparent 55%),
    radial-gradient(900px 600px at 70% 90%, rgba(255, 93, 135, 0.11), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-mono);
  font-size: clamp(16px, 1.1vw, 17.5px);
  color: var(--text);
  overflow-x: hidden;
  background-color: var(--bg-deep);
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(100, 168, 255, 0.11), transparent 55%),
    radial-gradient(1000px 700px at 85% 10%, rgba(164, 123, 255, 0.11), transparent 55%),
    radial-gradient(900px 600px at 70% 90%, rgba(255, 93, 135, 0.11), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-repeat: no-repeat;
  background-size: cover;
  line-height: 1.72;
}

/* Starfield — same as the main site. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 24px 30px, rgba(255, 255, 255, 0.92) 98%, transparent 100%),
    radial-gradient(1px 1px at 80px 90px, rgba(100, 168, 255, 0.78) 98%, transparent 100%),
    radial-gradient(1.1px 1.1px at 50px 120px, rgba(164, 123, 255, 0.72) 98%, transparent 100%),
    radial-gradient(0.9px 0.9px at 140px 40px, rgba(255, 255, 255, 0.7) 98%, transparent 100%),
    radial-gradient(1.4px 1.4px at 170px 160px, rgba(255, 93, 135, 0.88) 98%, transparent 100%),
    radial-gradient(1px 1px at 30px 50px, rgba(255, 255, 255, 0.55) 98%, transparent 100%),
    radial-gradient(0.9px 0.9px at 96px 42px, rgba(100, 168, 255, 0.52) 98%, transparent 100%),
    radial-gradient(0.9px 0.9px at 130px 110px, rgba(164, 123, 255, 0.52) 98%, transparent 100%),
    radial-gradient(1px 1px at 58px 154px, rgba(255, 93, 135, 0.5) 98%, transparent 100%),
    radial-gradient(0.8px 0.8px at 150px 150px, rgba(255, 255, 255, 0.42) 98%, transparent 100%),
    radial-gradient(0.7px 0.7px at 66px 84px, rgba(100, 168, 255, 0.3) 98%, transparent 100%),
    radial-gradient(0.7px 0.7px at 104px 28px, rgba(164, 123, 255, 0.28) 98%, transparent 100%),
    radial-gradient(0.7px 0.7px at 122px 122px, rgba(255, 93, 135, 0.28) 98%, transparent 100%);
  background-size: 180px 180px, 220px 220px, 260px 260px, 320px 320px, 420px 420px, 140px 140px, 160px 160px, 190px 190px, 210px 210px, 110px 110px, 70px 70px, 82px 82px, 94px 94px;
  background-position: 0 0, 40px 70px, 120px 20px, 10px 120px, 180px 80px, 0 0, 50px 26px, 20px 60px, 70px 110px, 0 0, 0 0, 8px 34px, 26px 6px;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
}

h1, h2, h3, h4, h5, h6, .nav-link, .brand-dropdown-content a { font-family: var(--font-sans); }

a { color: var(--blue); text-underline-offset: 0.2em; }
a:hover, a:focus-visible { color: #b9dcff; }

main {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 24px 120px;
}

/* ============================================================
   HEADER — copied verbatim from the main lunesynth.com site.
   ============================================================ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 30;
  isolation: isolate;
  --header-padding-y: 24px;
  margin-bottom: 36px;
  padding: var(--header-padding-y) 0;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(5, 10, 20, 0.92), rgba(5, 10, 20, 0.72));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 0.35s ease;
}

.site-header.is-scrolled::before { opacity: 1; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: contain;
  object-position: center;
  box-shadow: var(--glow);
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
}

.brand:hover, .brand:focus-visible { transform: translateY(-1px); }

.brand:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 18px;
}

.brand-chevron { font-size: 0.7em; opacity: 0.75; }

.brand-dropdown { position: relative; }

.brand-dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 0;
  box-shadow: var(--glow);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.brand-dropdown:hover .brand-dropdown-content,
.brand-dropdown:focus-within .brand-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.brand-dropdown-content a {
  display: block;
  padding: 9px 18px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-dropdown-content a:hover { background: rgba(100, 168, 255, 0.1); }

/* Hide the mobile popup header (with duplicated logo) in the desktop dropdown */
.brand-dropdown-content .brand-popup-header { display: none; }

.nav-links {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(102, 179, 255, 0.22);
  background: rgba(11, 16, 30, 0.5);
  color: #ffffff;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.3s ease, border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
}

.nav-link:hover, .nav-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(102, 179, 255, 0.42);
  color: var(--text);
}

.nav-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.nav-link--blog {
  border-color: rgba(164, 123, 255, 0.5);
  background: rgba(164, 123, 255, 0.14);
  color: #e4d8ff;
}

.nav-link[aria-current="page"] {
  border-color: var(--purple);
  background: rgba(164, 123, 255, 0.2);
  color: #e4d8ff;
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 100;
  width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid rgba(102, 179, 255, 0.22);
  background: rgba(11, 16, 30, 0.5);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  margin: -1px 0 0 -10px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.3s ease, background 0.2s ease;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; }

.nav-toggle__bars::before { transform: translateY(-6px); }
.nav-toggle__bars::after { transform: translateY(6px); }

.site-header.nav-open .nav-toggle__bars { background: transparent; }
.site-header.nav-open .nav-toggle__bars::before { transform: rotate(45deg); }
.site-header.nav-open .nav-toggle__bars::after { transform: rotate(-45deg); }

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: 940px;
  margin: 0 auto;
}

/* ---------- Blog index ---------- */
.blog-index { max-width: 1180px; }

.blog-hero { padding: clamp(24px, 5vw, 60px) 0 clamp(26px, 4vw, 44px); }

.blog-hero .eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--purple);
}

.blog-hero h1 {
  margin: 0 0 16px;
  padding-bottom: 0.06em;
  font-weight: 800;
  line-height: 1.14;
  font-size: clamp(36px, 7vw, 62px);
  letter-spacing: -0.02em;
  color: #b69dff;
}

.blog-hero p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(14px, 2.1vw, 17px);
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 24px);
  scroll-margin-top: calc(var(--sticky-header-height, 76px) + 20px);
}

.post-list > li {
  min-width: 0;
  height: 100%;
}

.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--glow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover, .post-card:focus-visible {
  border-color: rgba(164, 123, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 26px 60px rgba(4, 8, 22, 0.6), 0 0 30px rgba(164, 123, 255, 0.12);
}

.post-card__image {
  display: block;
  margin: calc(-1 * clamp(22px, 3vw, 32px)) calc(-1 * clamp(22px, 3vw, 32px)) clamp(18px, 2.5vw, 22px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  background: rgba(8, 17, 34, 0.9);
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.post-card:hover .post-card__image img,
.post-card:focus-visible .post-card__image img { transform: scale(1.05); }

.post-card__meta,
.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.post-card__tag,
.article__tag {
  padding: 4px 12px;
  border: 1px solid rgba(102, 179, 255, 0.28);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

.post-card h2 {
  margin: 0 0 10px;
  font-weight: 700;
  line-height: 1.28;
  padding-bottom: 0.04em;
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: -0.01em;
  color: #b69dff;
}

.post-card p { margin: 0; color: var(--muted); font-size: 14.5px; }

.post-card__more {
  display: inline-block;
  margin-top: auto;
  padding-top: 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.blog-pagination {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "previous pages next"
    ". status .";
  align-items: center;
  gap: 12px 18px;
  margin: clamp(34px, 5vw, 52px) 0 40px;
}

.blog-pagination__arrow,
.blog-pagination__page {
  min-height: 40px;
  border: 1px solid rgba(164, 123, 255, 0.34);
  border-radius: 999px;
  background: rgba(164, 123, 255, 0.1);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.blog-pagination__arrow {
  padding: 0 18px;
}

.blog-pagination__arrow:first-child { grid-area: previous; }
.blog-pagination__arrow:last-child { grid-area: next; }

.blog-pagination__pages {
  grid-area: pages;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-pagination__page {
  width: 40px;
  padding: 0;
}

.blog-pagination__page[aria-current="page"] {
  border-color: var(--purple);
  background: rgba(164, 123, 255, 0.26);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(164, 123, 255, 0.14);
}

.blog-pagination__arrow:hover:not(:disabled),
.blog-pagination__arrow:focus-visible:not(:disabled),
.blog-pagination__page:hover,
.blog-pagination__page:focus-visible {
  border-color: var(--purple);
  background: rgba(164, 123, 255, 0.2);
  transform: translateY(-1px);
}

.blog-pagination__arrow:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.blog-pagination__status {
  grid-area: status;
  justify-self: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

@media (max-width: 900px) {
  .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .post-list { grid-template-columns: 1fr; }

  .blog-pagination {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "pages pages"
      "previous next"
      "status status";
  }

  .blog-pagination__arrow { width: 100%; }
}

/* ---------- Article ---------- */
.article { padding: clamp(8px, 2vw, 24px) 0 40px; }

.article__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(164, 123, 255, 0.45);
  background: rgba(164, 123, 255, 0.14);
  color: #e4d8ff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.article__back:hover,
.article__back:focus-visible {
  transform: translateY(-2px);
  border-color: var(--purple);
  background: rgba(164, 123, 255, 0.24);
  color: #ffffff;
}

.article__author,
.post-card__author { color: var(--muted); }

.article h1 {
  margin: 0 0 18px;
  padding-bottom: 0.06em;
  font-weight: 800;
  line-height: 1.16;
  font-size: clamp(33px, 6vw, 54px);
  letter-spacing: -0.02em;
  color: #b69dff;
  overflow-wrap: anywhere;
}

.article__lede {
  margin: 0 0 10px;
  color: var(--text);
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.55;
}

.article__hero {
  width: 100%;
  max-width: 620px;
  margin: 22px auto 4px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--glow);
  background: rgba(8, 17, 34, 0.9);
}

.article__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.article__figure {
  width: 100%;
  max-width: 560px;
  margin: 34px auto;
}

.article__figure img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: block;
}

.article__figure figcaption {
  margin-top: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.article__body {
  min-width: 0;
  font-size: clamp(17px, 1.15vw, 18.5px);
  line-height: 1.78;
}

.article__body img,
.article__body video,
.article__body iframe,
.article__body table,
.article__body pre {
  max-width: 100%;
}

.article__body pre,
.article__body table {
  overflow-x: auto;
}

.article__body h2 {
  margin: 54px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-weight: 700;
  line-height: 1.25;
  font-size: clamp(21px, 3vw, 28px);
  letter-spacing: -0.01em;
  color: var(--text);
}

.article__body h3 { margin: 34px 0 12px; color: #d9e8fb; font-size: 18px; }

.article__body p,
.article__body li { color: var(--muted); overflow-wrap: anywhere; }

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

.article__body ul, .article__body ol { padding-left: 24px; }
.article__body li + li { margin-top: 8px; }

.article__body blockquote {
  margin: 28px 0;
  padding: 14px 22px;
  border-left: 3px solid var(--purple);
  border-radius: 0 12px 12px 0;
  background: rgba(164, 123, 255, 0.07);
  color: #e4ecfa;
  font-style: italic;
}

.article__body code {
  padding: 0.14em 0.4em;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #dceaff;
  background: rgba(8, 17, 34, 0.8);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article__body a { color: var(--blue); }

.article__cta {
  margin-top: 40px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--glow);
  color: var(--muted);
}
.article__cta strong { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  max-width: 940px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 22px;
  margin: clamp(56px, 8vw, 88px) auto 0;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 10% 20%, rgba(100, 168, 255, 0.12), transparent 32%),
    radial-gradient(circle at 90% 80%, rgba(164, 123, 255, 0.12), transparent 34%),
    rgba(8, 17, 34, 0.72);
  box-shadow: var(--glow);
  color: var(--muted);
  font-size: 12px;
}

.site-footer__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.site-footer__mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 22px rgba(164, 123, 255, 0.26);
}

.site-footer__copy {
  display: grid;
  gap: 2px;
  line-height: 1.35;
}

.site-footer__copy strong {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.site-footer__copy span { color: var(--muted); }

.site-footer nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.site-footer nav a {
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--text);
  border-color: rgba(164, 123, 255, 0.24);
  background: rgba(164, 123, 255, 0.08);
}

@media (max-width: 640px) {
  .site-footer {
    justify-content: center;
    padding: 22px 18px;
    text-align: center;
  }

  .site-footer nav {
    justify-content: center;
    width: 100%;
  }
}

/* ============================================================
   RESPONSIVE — header behavior copied from the main site.
   ============================================================ */
@media (max-width: 900px) {
  .site-header { margin-bottom: 28px; flex-wrap: nowrap; }
}

@media (max-width: 640px) {
  main { padding: 32px 16px 96px; }

  .site-header { --header-padding-y: 18px; }

  .brand { gap: clamp(8px, 2.5vw, 12px); min-width: 0; }

  .brand img {
    width: clamp(40px, 11vw, 52px);
    height: clamp(40px, 11vw, 52px);
    flex-shrink: 0;
  }

  .brand h1 {
    max-width: calc(100vw - 126px);
    overflow: hidden;
    font-size: clamp(11px, 3.4vw, 14px);
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .article {
    width: 100%;
    padding-top: 0;
  }

  .article__back {
    margin-bottom: 22px;
    padding: 9px 16px;
  }

  .article__meta {
    gap: 8px 10px;
    margin-bottom: 12px;
    font-size: 11px;
  }

  .article__tag { padding: 3px 9px; }

  .article h1 {
    margin-bottom: 14px;
    font-size: clamp(29px, 9.5vw, 40px);
    line-height: 1.12;
  }

  .article__lede {
    font-size: 16px;
    line-height: 1.6;
  }

  .article__hero {
    margin-top: 20px;
    border-radius: 14px;
  }

  .article__body {
    font-size: 15px;
    line-height: 1.75;
  }

  .article__body h2 {
    margin-top: 40px;
    padding-top: 12px;
    font-size: 22px;
  }

  .article__body h3 { margin-top: 28px; }

  .article__body ul,
  .article__body ol { padding-left: 20px; }

  .article__body blockquote {
    margin: 24px 0;
    padding: 13px 15px;
  }

  .article__figure { margin: 28px auto; }

  .article__cta {
    margin-top: 32px;
    padding: 18px;
    border-radius: 14px;
  }

  .nav-toggle { display: inline-flex; }

  .nav-links {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    padding: max(72px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    background: rgba(6, 8, 16, 0.92);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    overflow-y: auto;
  }

  .site-header.nav-open .nav-links { opacity: 1; visibility: visible; }

  .site-header.nav-open .nav-toggle__bars,
  .site-header.brand-open .nav-toggle__bars { background: transparent; }

  .site-header.nav-open .nav-toggle__bars::before,
  .site-header.brand-open .nav-toggle__bars::before { transform: rotate(45deg); }

  .site-header.nav-open .nav-toggle__bars::after,
  .site-header.brand-open .nav-toggle__bars::after { transform: rotate(-45deg); }

  .nav-links .nav-link {
    justify-content: center;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    letter-spacing: 0.08em;
  }

  /* Full screen brand dropdown popup on mobile (Coherascent Labs logo menu) */
  .brand-dropdown-content {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    padding: max(72px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    background: rgba(6, 8, 16, 0.92);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    overflow-y: auto;
  }

  .site-header.brand-open .brand-dropdown-content { opacity: 1; visibility: visible; }

  .brand-dropdown-content .brand-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(102, 179, 255, 0.2);
  }

  .brand-dropdown-content .brand-popup-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
  }

  .brand-dropdown-content .brand-popup-header .brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .brand-dropdown-content .brand-popup-header .brand h1 {
    font-size: 14px;
    letter-spacing: 0.1em;
    color: #ffffff;
    margin: 0;
  }

  .brand-dropdown-content a {
    justify-content: center;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    letter-spacing: 0.08em;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(102, 179, 255, 0.22);
    background: rgba(11, 16, 30, 0.5);
  }
}

/* ---------- Newsletter / waitlist capture (matches homepage) ---------- */
.blog-newsletter {
  width: 100%;
  max-width: 940px;
  margin: clamp(56px, 8vw, 88px) auto 0;
}

.hero-waitlist-panel {
  display: grid;
  gap: 14px;
  width: min(calc(100% - 68px), 680px);
  margin: 0 auto;
  padding: 20px;
  border: 1px solid rgba(164, 123, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 12%, rgba(100, 168, 255, 0.14), transparent 36%),
    radial-gradient(circle at 88% 24%, rgba(255, 93, 135, 0.12), transparent 34%),
    rgba(5, 12, 26, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 44px rgba(4, 10, 24, 0.22);
  backdrop-filter: blur(10px);
}

.hero-waitlist-copy {
  display: grid;
  gap: 6px;
}

.hero-waitlist-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
}

.hero-waitlist-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  text-wrap: balance;
}

.waitlist-offer {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
  font-weight: 500;
  text-wrap: balance;
}

.waitlist-offer .blue-glow {
  display: inline-block;
  font-weight: 800;
  background-image: linear-gradient(135deg, #a5f3fc 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(100, 168, 255, 0.35));
}

.waitlist-offer .red-glow {
  display: inline-block;
  font-weight: 800;
  background-image: linear-gradient(135deg, #fecdd3 0%, var(--red) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 93, 135, 0.35));
}

.hero-waitlist {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: center;
  width: min(100%, 560px);
  padding: 6px;
  border: 1px solid rgba(164, 123, 255, 0.18);
  border-radius: 999px;
  background: rgba(4, 9, 20, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 34px rgba(4, 10, 24, 0.2);
}

.hero-waitlist input {
  min-width: 0;
  flex: 1 1 auto;
  height: 42px;
  border: 0;
  padding: 0 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.hero-waitlist input::placeholder {
  color: rgba(166, 186, 215, 0.82);
}

.hero-waitlist button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--blue), var(--purple), var(--red));
  color: #06111f;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(100, 168, 255, 0.16),
    0 10px 24px rgba(255, 93, 135, 0.12);
}

.hero-waitlist button:hover,
.hero-waitlist button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px rgba(100, 168, 255, 0.2),
    0 12px 28px rgba(255, 93, 135, 0.16);
}

@media (max-width: 640px) {
  .blog-newsletter {
    display: flex;
    justify-content: center;
  }

  .hero-waitlist-panel {
    width: 100%;
    max-width: 520px;
    padding: 20px 16px;
  }

  .hero-waitlist {
    width: 100%;
    max-width: 420px;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border-radius: 20px;
  }

  .hero-waitlist input {
    width: 100%;
    flex: 0 0 42px;
    text-align: center;
  }

  .hero-waitlist button {
    width: min(100%, 220px);
    align-self: center;
  }
}

.waitlist-popup[hidden] {
  display: none;
}

.waitlist-popup {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 7, 16, 0.64);
  backdrop-filter: blur(10px);
}

.waitlist-popup__panel {
  position: relative;
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid rgba(164, 123, 255, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(100, 168, 255, 0.18), transparent 36%),
    radial-gradient(circle at 86% 22%, rgba(255, 93, 135, 0.14), transparent 34%),
    rgba(6, 12, 26, 0.94);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
}

.waitlist-popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(164, 123, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.waitlist-popup__close:hover,
.waitlist-popup__close:focus-visible {
  outline: none;
  background: rgba(100, 168, 255, 0.16);
  border-color: rgba(100, 168, 255, 0.34);
}

.waitlist-popup h3 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0;
}

.waitlist-popup p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.waitlist-popup__action {
  margin-top: 20px;
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--blue), var(--purple), var(--red));
  color: #06111f;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(100, 168, 255, 0.16),
    0 10px 24px rgba(255, 93, 135, 0.12);
}

.waitlist-popup__action:hover,
.waitlist-popup__action:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px rgba(100, 168, 255, 0.2),
    0 12px 28px rgba(255, 93, 135, 0.16);
}
