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

:root {
  --ink: #151936;
  --ink-2: #30395f;
  --muted: rgba(21, 25, 54, 0.64);
  --paper: #fffaf0;
  --paper-2: #f6eddf;
  --paper-3: #ede0ce;
  --berry: #a6144d;
  --berry-2: #c72763;
  --berry-soft: #f9dce8;
  --line: rgba(21, 25, 54, 0.13);
  --line-strong: rgba(166, 20, 77, 0.24);
  --shadow: 0 28px 80px rgba(36, 24, 19, 0.14);
  --display: "Instrument Serif", Georgia, serif;
  --body: "Figtree", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.65;
  background:
    radial-gradient(circle at 12% 18%, rgba(166, 20, 77, 0.13), transparent 28rem),
    radial-gradient(circle at 82% 0%, rgba(20, 26, 71, 0.12), transparent 24rem),
    linear-gradient(135deg, #fffdf8 0%, var(--paper) 42%, #f8eee6 100%);
  min-height: 100vh;
}

body.menu-open {
  overflow: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  mix-blend-mode: multiply;
  z-index: 0;
  background-image:
    linear-gradient(rgba(21, 25, 54, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 25, 54, 0.03) 1px, transparent 1px);
  background-size: 34px 34px;
}

.site-nav,
footer,
main {
  position: relative;
  z-index: 1;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 48px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(20, 26, 71, 0.1);
  box-shadow: 0 10px 30px rgba(20, 26, 71, 0.06);
  backdrop-filter: blur(20px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.logo-text {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 19px;
}

.logo-text span {
  color: var(--berry);
}

.nav-links,
.nav-ctas,
.mobile-menu-links,
.mobile-menu-ctas,
.foot-links,
.hero-actions,
.post-meta,
.tag-row,
.card-tags,
.article-actions {
  display: flex;
  align-items: center;
}

.nav-links {
  gap: 24px;
}

.nav-links a,
.mobile-menu-links a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links a.cur,
.mobile-menu-links a:hover,
.mobile-menu-links a.cur {
  color: var(--ink);
}

.nav-ctas {
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.site-nav .btn,
.mobile-menu-ctas .btn {
  font-weight: 500;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--berry);
  color: #fff;
  box-shadow: 0 16px 34px rgba(166, 20, 77, 0.24);
}

.btn-ghost,
.btn-paper {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.42);
  border-color: var(--line);
}

.btn-paper:hover,
.btn-ghost:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px rgba(21, 25, 54, 0.08);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 74px;
  left: 16px;
  right: 16px;
  z-index: 19;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.98);
  box-shadow: var(--shadow);
}

.mobile-menu.open {
  display: block;
}

.mobile-menu-links,
.mobile-menu-ctas {
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu-links a {
  padding: 10px 12px;
  border-radius: 12px;
}

.mobile-menu-links a:hover {
  background: var(--berry-soft);
}

.mobile-menu-ctas {
  margin-top: 10px;
}

main {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
}

.blog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: 42px;
  min-height: 430px;
  padding: 56px 0 42px;
}

.hero-copy {
  max-width: 780px;
  animation: rise 700ms ease both;
}

.eyebrow,
.card-kicker,
.filter-label {
  display: inline-flex;
  margin: 0 0 14px;
  color: var(--berry);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  max-width: 900px;
  font-family: var(--display);
  font-size: clamp(4.2rem, 11vw, 9.7rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.07em;
}

.blog-hero h1 {
  font-size: clamp(2.06rem, 5.39vw, 4.75rem);
  line-height: 0.9;
}

.hero-copy p:not(.eyebrow) {
  max-width: 660px;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 32px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.64), rgba(255, 250, 240, 0.42)),
    linear-gradient(135deg, rgba(166, 20, 77, 0.12), transparent 58%);
  box-shadow: var(--shadow);
  animation: rise 700ms ease 120ms both;
}

.hero-card strong {
  display: block;
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: 3.1rem;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.hero-card p {
  color: var(--ink-2);
  margin-bottom: 26px;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  height: 84px;
  align-items: end;
}

.signal-strip span {
  display: block;
  border-radius: 999px 999px 8px 8px;
  background: var(--berry);
  opacity: 0.86;
}

.signal-strip span:nth-child(1) { height: 34%; }
.signal-strip span:nth-child(2) { height: 58%; }
.signal-strip span:nth-child(3) { height: 42%; }
.signal-strip span:nth-child(4) { height: 82%; }
.signal-strip span:nth-child(5) { height: 66%; }

.controls-panel {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 20px 70px rgba(21, 25, 54, 0.07);
}

.filter-stack {
  display: grid;
  gap: 14px;
}

.search-wrap label,
.topic-wrap label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-wrap input,
.topic-wrap select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 250, 240, 0.82);
  color: var(--ink);
  font: 700 13px var(--body);
  outline: none;
}

.topic-wrap select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--berry) 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--berry) 50%, transparent 50%) right 13px center / 6px 6px no-repeat,
    rgba(255, 250, 240, 0.82);
  cursor: pointer;
}

.search-wrap input:focus,
.topic-wrap select:focus {
  border-color: var(--berry);
  box-shadow: 0 0 0 4px rgba(166, 20, 77, 0.11);
}

.controls-copy {
  max-width: 760px;
}

.controls-copy h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.1rem, 4.2vw, 4.06rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.tag-btn,
.copy-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.7);
  color: var(--ink-2);
  cursor: pointer;
  font: 800 13px var(--body);
  padding: 10px 13px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.tag-btn:hover,
.tag-btn.active,
.copy-btn:hover {
  background: var(--berry);
  border-color: var(--berry);
  color: #fff;
  transform: translateY(-1px);
}

.blog-shell {
  padding: 44px 0 86px;
}

.section-heading {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 34px;
  align-items: end;
  margin-bottom: 30px;
}

.section-heading h2 {
  max-width: 780px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  position: relative;
  display: flex;
  min-height: 360px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 14px 40px rgba(21, 25, 54, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: rise 520ms ease both;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.post-card.featured {
  grid-column: span 2;
  min-height: 430px;
  background:
    linear-gradient(140deg, rgba(166, 20, 77, 0.92), rgba(136, 17, 65, 0.9)),
    var(--berry);
  color: #fff;
}

.post-card.featured .post-card-dek,
.post-card.featured .post-meta,
.post-card.featured .post-card-label {
  color: rgba(255, 255, 255, 0.78);
}

.post-card-label {
  color: var(--berry);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.post-card h3 {
  margin: 20px 0 14px;
  font-family: var(--display);
  font-size: clamp(2.1rem, 3.8vw, 4.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.post-card:not(.featured) h3 {
  font-size: 2.35rem;
}

.post-card-dek {
  color: var(--ink-2);
  font-size: 15px;
}

.post-meta {
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.card-tags {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}

.card-tags span {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
  opacity: 0.72;
}

.empty-state,
.article-view {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 250, 240, 0.76);
  box-shadow: var(--shadow);
}

.empty-state {
  padding: 44px;
  text-align: center;
}

.article-view {
  margin-bottom: 56px;
  overflow: hidden;
}

.article-hero {
  padding: clamp(28px, 5vw, 62px);
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.22), transparent 18rem),
    linear-gradient(135deg, var(--berry), #771239);
  color: #fff;
}

.article-hero .eyebrow,
.article-hero .post-meta {
  color: rgba(255, 255, 255, 0.78);
}

.back-link {
  display: inline-flex;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.article-hero h1,
.article-hero h2 {
  max-width: 880px;
  margin-bottom: 18px;
  font-family: var(--display);
  font-size: clamp(2.24rem, 5.6vw, 5.18rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.article-hero p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.15rem;
}

.article-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.article-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 720px);
  gap: clamp(20px, 5vw, 70px);
  padding: clamp(28px, 5vw, 64px);
}

.article-side {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.article-content h2,
.article-content h3 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}

.article-content section + section {
  margin-top: 42px;
}

.article-content p {
  color: var(--ink-2);
  font-size: 1.04rem;
}

.article-content p:last-child {
  margin-bottom: 0;
}

.related-block {
  padding: 0 clamp(28px, 5vw, 64px) clamp(28px, 5vw, 64px);
}

.related-block h2,
.related-block h3 {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.04em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.42);
}

.related-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
}

.related-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 48px;
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.56);
}

.foot-links {
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.foot-copy {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .site-nav {
    padding: 14px 22px;
  }

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

  .nav-links,
  .nav-ctas {
    display: none;
  }

  .blog-hero,
  .controls-panel,
  .section-heading,
  .article-body {
    grid-template-columns: 1fr;
  }

  .blog-hero {
    min-height: auto;
    padding-top: 42px;
  }

  .hero-card {
    max-width: 520px;
  }

  .post-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 680px) {
  main {
    width: min(100% - 28px, 1180px);
  }

  h1 {
    font-size: clamp(3.45rem, 17vw, 5.5rem);
  }

  .blog-hero {
    padding-bottom: 28px;
  }

  .controls-panel {
    padding: 14px;
    border-radius: 22px;
  }

  .post-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-card.featured {
    grid-column: auto;
  }

  .post-card,
  .post-card.featured {
    min-height: 320px;
  }

  .article-hero h1,
  .article-hero h2 {
    font-size: clamp(2.1rem, 10.5vw, 3.64rem);
  }

  footer {
    flex-direction: column;
    padding: 28px 20px;
    text-align: center;
  }
}


/* Feature discoverability: desktop mega menu plus crawlable links. */
.nav-mega {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-mega > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nav-mega > a::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.75;
}
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 120;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  width: min(620px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line-strong, rgba(166, 20, 77, 0.24));
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow, 0 28px 70px rgba(20, 26, 71, 0.18));
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(18px);
}
.nav-mega:hover .mega-menu,
.nav-mega:focus-within .mega-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.mega-menu a {
  display: block;
  border-radius: 16px;
  padding: 14px;
  color: var(--ink, #141a47) !important;
  text-decoration: none;
}
.mega-menu a:hover,
.mega-menu a.cur {
  background: var(--berry-soft, #fdeaf1);
  color: var(--ink, #141a47) !important;
}
.mega-menu strong,
.mega-menu span {
  display: block;
}
.mega-menu strong {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: -0.01em;
}
.mega-menu span {
  color: rgba(20, 26, 71, 0.62);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.mobile-menu-links a[href^="/features/"]:not(:first-child) {
  padding-left: 28px;
  font-size: 14px;
}
@media (max-width: 980px) {
  .nav-mega .mega-menu {
    display: none;
  }
}

/* Four-column footer layout. */
footer {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(150px, 1fr));
  align-items: start !important;
  gap: 32px;
  text-align: left;
}
.footer-brand,
.footer-col {
  display: grid;
  align-content: start;
  gap: 12px;
}
.footer-brand .logo { align-self: start; }
.footer-address {
  max-width: 220px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.footer-title {
  margin: 0;
  color: var(--ink, var(--white, #141a47));
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}
.foot-links {
  display: grid !important;
  width: auto !important;
  justify-content: start !important;
  gap: 9px !important;
}
.foot-links a {
  display: inline-flex;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
}
.foot-links a:hover { color: var(--ink); }
.foot-copy { margin-top: 4px; }
@media (max-width: 900px) {
  footer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  footer {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .foot-links { justify-items: start; }
}
