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

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #c8e0f4;
  --secondary: #f5e0e8;
  --ink: #171f26;
  --ink-muted: #4a5568;
  --ink-light: #718096;
  --rail-w: 260px;
  --radius: 14px;
  --radius-sm: 10px;
  --neu-bg: #d4e8f6;
  --neu-shadow-light: rgba(255,255,255,0.85);
  --neu-shadow-dark: rgba(0,0,0,0.13);
  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --transition: 150ms ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--primary);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Screen-reader only ─── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── Page Shell ─── */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── Nav Rail (aside > nav > ul > li > a) ─── */
.nav-rail {
  position: fixed;
  top: 0; left: 0;
  width: var(--rail-w);
  height: 100vh;
  background: linear-gradient(165deg, #cce4f7 0%, #bcd8ef 100%);
  box-shadow: 5px 0 20px var(--neu-shadow-dark), -2px 0 8px var(--neu-shadow-light) inset;
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 200;
  overflow-y: auto;
  padding-bottom: 1.5rem;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.4rem 1.2rem 1rem;
  border-bottom: 1px solid rgba(23,31,38,0.1);
}

.brand-logo {
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.rail-search {
  padding: 0.9rem 1rem 0.5rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: none;
  font-family: var(--font);
  font-size: 0.875rem;
  background: linear-gradient(145deg, #c0d9ee, #d8ecff);
  box-shadow: -3px -3px 8px var(--neu-shadow-light), 3px 3px 8px var(--neu-shadow-dark);
  color: var(--ink);
  outline: none;
  transition: box-shadow var(--transition);
}

.search-input:focus {
  box-shadow: inset 2px 2px 6px var(--neu-shadow-dark), inset -2px -2px 6px var(--neu-shadow-light);
}

/* Nav inside rail */
.nav-rail nav { flex: 1; padding: 0.5rem 0; }

.nav-rail nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 0.75rem;
}

.nav-rail nav ul li { display: block; }

.rail-link {
  display: block;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: box-shadow var(--transition), background var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.rail-link:hover {
  background: linear-gradient(145deg, #d4ecff, #b8d4ec);
  box-shadow: -3px -3px 8px var(--neu-shadow-light), 3px 3px 8px var(--neu-shadow-dark);
}

.rail-link.active {
  background: linear-gradient(145deg, #b5d3ec, #cce5ff);
  box-shadow: inset 2px 2px 5px var(--neu-shadow-dark), inset -2px -2px 5px var(--neu-shadow-light);
  font-weight: 700;
}

/* Rail CTAs */
.rail-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid rgba(23,31,38,0.1);
  margin-top: auto;
}

/* ─── CTA Buttons ─── */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}

.cta-signup {
  background: var(--ink);
  color: var(--primary);
  box-shadow: -3px -3px 8px var(--neu-shadow-light), 3px 3px 8px var(--neu-shadow-dark);
}

.cta-signup:hover {
  box-shadow: -4px -4px 12px var(--neu-shadow-light), 4px 4px 12px var(--neu-shadow-dark);
  transform: scale(1.03);
}

.cta-signup:active { transform: scale(0.97); }

.cta-login {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: -2px -2px 6px var(--neu-shadow-light), 2px 2px 6px var(--neu-shadow-dark);
}

.cta-login:hover {
  background: linear-gradient(145deg, #c0d9ee, #d8ecff);
  box-shadow: -3px -3px 8px var(--neu-shadow-light), 3px 3px 8px var(--neu-shadow-dark);
}

.cta-sm {
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  min-height: 44px;
}

/* ─── Mobile Header ─── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(135deg, #cce4f7 0%, #c0d8ef 100%);
  box-shadow: 0 3px 12px var(--neu-shadow-dark);
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  z-index: 300;
}

.mobile-brand {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
  max-width: 140px;
}

.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #d4ecff, #b8d4ec);
  box-shadow: -2px -2px 6px var(--neu-shadow-light), 2px 2px 6px var(--neu-shadow-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] .toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .toggle-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── Main Content Area ─── */
.main-content-area {
  margin-left: var(--rail-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Dot-Matrix / Hero ─── */
.dot-matrix {
  background-color: #c0d8ef;
  background-image: radial-gradient(circle, rgba(23,31,38,0.18) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hero-section {
  min-height: 45vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  padding: 3rem 3rem 2.5rem;
}

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

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

.hero-copy h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.hero-lead {
  font-size: 1rem;
  color: var(--ink-muted);
  line-height: 1.6;
  max-width: 440px;
}

.hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: -5px -5px 15px var(--neu-shadow-light), 5px 5px 15px var(--neu-shadow-dark);
}

.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

.hero-placeholder {
  min-height: 260px;
  background: linear-gradient(145deg, #b8d4ec, #d8ecff);
}

/* Inner / compact hero */
.inner-hero {
  padding: 2rem 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.inner-hero-copy h1 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.inner-hero-media img {
  max-width: 240px;
  border-radius: var(--radius);
  box-shadow: -4px -4px 12px var(--neu-shadow-light), 4px 4px 12px var(--neu-shadow-dark);
}

.compact-hero { min-height: auto; }

/* Page masthead */
.page-masthead {
  padding: 2.5rem 3rem 2rem;
}

.page-masthead h1 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.masthead-desc {
  color: var(--ink-muted);
  font-size: 1rem;
  max-width: 600px;
}

/* ─── Byline ─── */
.byline {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.byline strong { color: var(--ink); }

/* Stage badge */
.stage-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.stage-awareness { background: var(--secondary); color: var(--ink); }
.stage-consideration { background: #e0f0ff; color: var(--ink); }
.stage-decision { background: var(--ink); color: var(--primary); }

/* ─── Main / Wrap / Section / Article (4-level deep nesting) ─── */
main {
  padding: 2rem 0;
  flex: 1;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

.content-section {
  background: linear-gradient(150deg, #d6ecff 0%, #cce3f5 100%);
  border-radius: var(--radius);
  box-shadow: -5px -5px 15px var(--neu-shadow-light), 5px 5px 15px var(--neu-shadow-dark);
  padding: 2.5rem;
}

article.prose-area {
  /* the article container */
}

/* ─── Prose Styles ─── */
.prose-area h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.25rem;
  color: var(--ink);
}

.prose-area h2:first-child { margin-top: 0; }

.prose-area h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.prose-area p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.prose-area ul, .prose-area ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.prose-area li { margin-bottom: 0.4rem; line-height: 1.6; }

.prose-area a {
  color: #1a5fa8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose-area a:hover { color: var(--ink); }

.prose-area table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.prose-area th {
  background: var(--ink);
  color: var(--primary);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 700;
}

.prose-area td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(23,31,38,0.1);
}

.prose-area tr:nth-child(even) td {
  background: rgba(200,224,244,0.4);
}

.prose-area blockquote {
  border-left: 3px solid var(--ink);
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  background: rgba(200,224,244,0.3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

/* Subtitle (h2 + p.subtitle) */
p.subtitle, .subtitle {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-top: 0;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* ─── Child Grid (ul > li > article) ─── */
.child-grid-section {
  padding: 2rem 2rem 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.child-grid-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.child-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.child-grid li { display: block; }

.card-outlined {
  border: 2px solid rgba(23,31,38,0.2);
  border-radius: 0;
  padding: 1.25rem;
  background: linear-gradient(145deg, #d4ecff, #c8e0f4);
  transition: box-shadow var(--transition), transform var(--transition);
}

.card-outlined:hover {
  box-shadow: -3px -3px 10px var(--neu-shadow-light), 3px 3px 10px var(--neu-shadow-dark);
  transform: translateY(-2px);
}

.card-outlined h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.card-outlined h3 a {
  color: var(--ink);
  text-decoration: none;
}

.card-outlined h3 a:hover { text-decoration: underline; }

.card-outlined p {
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.card-date {
  font-size: 0.75rem;
  color: var(--ink-light);
}

/* ─── Related Links ─── */
.related-links {
  padding: 1.5rem 2rem 2rem;
  max-width: 860px;
  margin: 0 auto;
}

.related-links h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.related-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.related-links ul li a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(145deg, #d4ecff, #b8d4ec);
  box-shadow: -2px -2px 6px var(--neu-shadow-light), 2px 2px 6px var(--neu-shadow-dark);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: box-shadow var(--transition);
}

.related-links ul li a:hover {
  box-shadow: inset 2px 2px 5px var(--neu-shadow-dark), inset -2px -2px 5px var(--neu-shadow-light);
}

/* ─── Pricing Section ─── */
.pricing-section .prose-area { /* inherits from prose-area */ }

/* ─── FAQ Section ─── */
.faq-section .prose-area details {
  border-bottom: 1px solid rgba(23,31,38,0.12);
  padding: 0.75rem 0;
}

.faq-section .prose-area summary {
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  padding: 0.25rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ─── Author Card ─── */
.author-section {
  padding: 2rem;
  max-width: 860px;
  margin: 0 auto;
}

.author-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.neu-card {
  background: linear-gradient(150deg, #d6ecff 0%, #cce3f5 100%);
  border-radius: var(--radius);
  box-shadow: -5px -5px 15px var(--neu-shadow-light), 5px 5px 15px var(--neu-shadow-dark);
  padding: 1.75rem;
  margin-top: 1rem;
}

.author-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.author-credentials {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.author-bio {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

/* ─── Footer ─── */
.site-footer {
  background: linear-gradient(160deg, #172030 0%, #1e2c3d 100%);
  color: rgba(200,224,244,0.9);
  margin-top: auto;
}

/* footer > nav.footer-nav — direct child is nav */
.footer-nav { padding: 2.5rem 2rem 1rem; }

.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.footer-wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.footer-blurb {
  font-size: 0.82rem;
  color: rgba(200,224,244,0.65);
  line-height: 1.6;
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-links-col ul li a {
  color: rgba(200,224,244,0.8);
  text-decoration: none;
  font-size: 0.83rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}

.footer-links-col ul li a:hover { color: var(--primary); text-decoration: underline; }

.footer-bottom {
  border-top: 1px solid rgba(200,224,244,0.12);
  padding: 1rem 2rem;
  max-width: 860px;
  margin: 0 auto;
}

.rg-notice {
  font-size: 0.75rem;
  color: rgba(200,224,244,0.55);
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.copyright {
  font-size: 0.75rem;
  color: rgba(200,224,244,0.4);
}

.trust-links {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.trust-links a {
  color: rgba(200,224,244,0.55);
  text-decoration: underline;
}

.trust-links a:hover { color: var(--primary); }

/* ─── Images ─── */
img { max-width: 100%; height: auto; display: block; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--primary); }
::-webkit-scrollbar-thumb { background: rgba(23,31,38,0.2); border-radius: 3px; }

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ─── Desktop nav open state (for JS toggle if needed) ─── */
@media (min-width: 769px) {
  .nav-rail { transform: none !important; }
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  :root { --rail-w: 0px; }

  .nav-rail {
    width: 280px;
    transform: translateX(-100%);
    transition: transform 250ms ease;
  }

  .nav-rail.open { transform: translateX(0); }

  .mobile-header { display: flex; }

  .main-content-area {
    margin-left: 0;
    padding-top: 60px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 1.5rem 1rem 1rem;
    gap: 1rem;
  }

  .hero-media { display: none; }

  .inner-hero {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem 1rem;
  }

  .inner-hero-media { display: none; }

  .page-masthead { padding: 1.25rem 1rem 1rem; }

  .wrap { padding: 0 1rem; }

  .content-section { padding: 1.5rem 1rem; }

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

  .child-grid-section { padding: 1.25rem 1rem; }

  .footer-inner { grid-template-columns: 1fr; gap: 1.25rem; }

  .footer-nav { padding: 1.5rem 1rem 0.75rem; }

  .footer-bottom { padding: 0.75rem 1rem; }

  .related-links { padding: 1rem; }

  .author-section { padding: 1rem; }
}

@media (max-width: 480px) {
  .hero-copy h1 { font-size: 1.35rem; }
  .cta-sm { font-size: 0.7rem; padding: 0.3rem 0.65rem; }
  .footer-wordmark { font-size: 1.1rem; }
}

/* ─── Overlay for mobile nav ─── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(23,31,38,0.4);
  z-index: 199;
}

.nav-overlay.active { display: block; }

a[data-cta],button[aria-controls]{min-height:44px;min-width:44px;box-sizing:border-box}main p a{text-decoration:underline}