/* ============================================================
   Da Vinci Diamonds Hub — Neubrutalist UI
   Space Grotesk / Inter system; primary #3bb1ff / #ff5252 / #000
   ============================================================ */

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

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

body {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #000;
  background: #fff;
  overflow-x: hidden;
  max-width: 100%;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: #0056b3;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: #ff5252; }

small {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

strong { font-weight: 700; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.35rem; line-height: 1.6; }

/* ---------- Layout Shell ---------- */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: #fff;
  border-top: 3px solid #000;
  box-shadow: 0 -4px 0 #000;
  max-width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 60px;
  width: 100%;
}

/* Brand mark */
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #3bb1ff;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  text-decoration: none;
  flex-shrink: 0;
  color: #000;
  font-weight: 700;
  font-size: 1.1rem;
  transition: box-shadow 0.15s, transform 0.15s;
}
.brand-mark:hover {
  box-shadow: 5px 5px 0 #000;
  transform: translate(-1px, -1px);
  color: #000;
}
.brand-mark img { width: 32px; height: 32px; object-fit: contain; }
.brand-icon { font-size: 1.2rem; }

/* Nav toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  cursor: pointer;
  flex-shrink: 0;
  transition: box-shadow 0.15s, transform 0.15s;
}
.nav-toggle:hover {
  box-shadow: 5px 5px 0 #000;
  transform: translate(-1px, -1px);
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #000;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Primary Nav */
.primary-nav {
  display: none;
  position: fixed;
  bottom: 66px;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  z-index: 850;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}
.primary-nav.is-open {
  display: block;
}
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.nav-list li { border-bottom: 2px solid #eee; }
.nav-list li:last-child { border-bottom: none; }
.nav-list a {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #000;
  text-decoration: none;
  min-height: 44px;
  word-break: break-word;
  transition: background 0.1s;
}
.nav-list a:hover { background: #3bb1ff; color: #000; }

/* Header CTAs */
.header-ctas {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 3px solid #000;
  min-height: 44px;
  min-width: 64px;
  white-space: nowrap;
  transition: box-shadow 0.15s, transform 0.15s;
}
.cta:hover {
  box-shadow: 4px 4px 0 #000;
  transform: translate(-2px, -2px);
  color: #000;
}
.cta-signup {
  background: #3bb1ff;
  color: #000;
  box-shadow: 3px 3px 0 #000;
}
.cta-login {
  background: #fff;
  color: #000;
  box-shadow: 3px 3px 0 #000;
}

/* ---------- Hero (Home) ---------- */
.hero--home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 80px;
  max-width: 100%;
  overflow-x: hidden;
}

.hero-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
  padding: 3rem 1.5rem 2rem;
  background: #3bb1ff;
  border-bottom: 3px solid #000;
  min-width: 0;
}

.hero-eyebrow {
  margin-bottom: 0.5rem;
}
.hero-eyebrow small {
  background: #000;
  color: #fff;
  padding: 0.2rem 0.5rem;
  display: inline-block;
}

.hero-copy h1 {
  max-width: 700px;
  color: #000;
  margin-bottom: 1rem;
  word-break: break-word;
}

.hero-lead {
  max-width: 540px;
  font-size: 1.1rem;
  font-weight: 500;
  color: #000;
  margin-bottom: 0;
}

.hero-media {
  flex-shrink: 0;
  background: #000;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-width: 100%;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-media--placeholder {
  min-height: 220px;
}
.gem-panel {
  color: #3bb1ff;
  font-size: 5rem;
  font-weight: 700;
  transform: rotate(45deg);
}

/* ---------- Inner Hero (guide / faq / about / privacy) ---------- */
.inner-hero, .guide-hero-bar {
  background: #ff5252;
  border-bottom: 3px solid #000;
  padding: 3rem 1.5rem 2rem;
  margin-bottom: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.inner-hero-copy small,
.guide-hero-inner small {
  background: #000;
  color: #fff;
  padding: 0.2rem 0.5rem;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.inner-hero-copy h1,
.guide-hero-inner h1 {
  color: #000;
  margin-top: 0.5rem;
  word-break: break-word;
}

.guide-hero-bar {
  background: #ff5252;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.guide-hero-inner {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.guide-hero-media {
  flex-shrink: 0;
  width: 260px;
  max-width: 100%;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  overflow: hidden;
}
.guide-hero-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Stage badge */
.stage-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border: 2px solid #000;
  margin-bottom: 0.5rem;
}
.stage-awareness  { background: #3bb1ff; }
.stage-consideration { background: #fff; }
.stage-decision   { background: #ff5252; color: #000; }

/* ---------- Byline ---------- */
.byline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #000;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.byline-sep { color: #555; }
.byline time { font-weight: 600; }

/* ---------- Main / Content Layout ---------- */
main {
  flex: 1;
  padding-bottom: 5rem;
  max-width: 100%;
  overflow-x: hidden;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-width: 0;
  width: 100%;
}

.content-section {
  padding: 2rem 0;
  min-width: 0;
  max-width: 100%;
}

.page-article {
  display: flex;
  gap: 0;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

/* Sidebar LEFT */
.sidebar--left {
  width: 220px;
  flex-shrink: 0;
  margin-right: 2rem;
  position: sticky;
  top: 1rem;
  align-self: flex-start;
  min-width: 0;
}

.sidebar-inner {
  background: #fff;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  padding: 1rem 1.1rem;
  word-break: break-word;
  overflow-x: hidden;
}

.sidebar-inner small {
  display: block;
  margin-bottom: 0.4rem;
}

.sidebar-heading {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #000;
  padding-bottom: 0.35rem;
}

.sidebar-links, .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-links li, .toc-list li {
  border-bottom: 1px solid #eee;
  margin: 0;
}
.sidebar-links li:last-child, .toc-list li:last-child { border-bottom: none; }
.sidebar-links a, .toc-list a {
  display: flex;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  min-height: 44px;
  word-break: break-word;
  transition: color 0.1s;
}
.sidebar-links a:hover, .toc-list a:hover { color: #ff5252; }

/* Article body */
.article-body {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* ---------- Page Content (injected HTML) ---------- */
.page-content {
  font-size: 1rem;
  line-height: 1.7;
  max-width: 780px;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
.page-content h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
.page-content h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.page-content p { margin-bottom: 1rem; }
.page-content ul, .page-content ol { margin-bottom: 1rem; }
.page-content a {
  color: #0056b3;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-content a:hover { color: #ff5252; }

/* Tables: scrollable wrapper pattern to prevent page-level overflow */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
  min-width: 0;
}
.page-content th {
  background: #000;
  color: #fff;
  padding: 0.55rem 0.75rem;
  text-align: left;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
}
.page-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid #000;
  white-space: normal;
  word-break: break-word;
}
.page-content tr:nth-child(even) td { background: #f5f5f5; }

/* Wrap every table in a scrollable div via CSS overflow */
.page-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1.5rem;
  max-width: 100%;
}
.page-content .table-wrap table {
  margin-bottom: 0;
}

.page-content blockquote {
  border-left: 4px solid #3bb1ff;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: #f0f9ff;
  font-style: italic;
  word-break: break-word;
}

/* Ensure images in content don't overflow */
.page-content img {
  max-width: 100%;
  height: auto;
}

/* Ensure pre/code doesn't overflow */
.page-content pre {
  overflow-x: auto;
  max-width: 100%;
}

/* ---------- Child-page cards (home) ---------- */
.child-grid {
  margin-top: 2.5rem;
  max-width: 100%;
  overflow-x: hidden;
}
.child-grid > small {
  display: block;
  margin-bottom: 0.4rem;
}
.child-grid > h2 {
  margin-bottom: 1.25rem;
}
.child-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 100%;
}
.child-card {
  background: #3bb1ff;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  padding: 1.1rem 1.2rem;
  border-radius: 4px;
  min-width: 0;
  transition: box-shadow 0.15s, transform 0.15s;
}
.child-card:hover {
  box-shadow: 7px 7px 0 #000;
  transform: translate(-2px, -2px);
}
.child-card dt a {
  font-weight: 700;
  font-size: 0.95rem;
  color: #000;
  text-decoration: none;
  display: flex;
  align-items: center;
  min-height: 44px;
  word-break: break-word;
}
.child-card dt a:hover { text-decoration: underline; }
.child-card dd {
  font-size: 0.85rem;
  color: #000;
  margin-top: 0.35rem;
  line-height: 1.5;
  word-break: break-word;
}

/* ---------- FAQ specific ---------- */
.faq-intro {
  margin-bottom: 1.5rem;
}
.faq-intro small {
  display: block;
  margin-bottom: 0.35rem;
}

/* ---------- Author section (about) ---------- */
.author-section {
  background: #fff;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  padding: 1.5rem;
  margin-bottom: 2rem;
  max-width: 720px;
  word-break: break-word;
  overflow-x: hidden;
}
.author-section small {
  display: block;
  margin-bottom: 0.4rem;
}
.author-section h2 {
  margin-bottom: 0.4rem;
}
.author-credentials {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: #333;
}
.author-bio {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #000;
  color: #fff;
  border-top: 3px solid #000;
  padding-bottom: 72px;
  max-width: 100%;
  overflow-x: hidden;
}

.site-footer section { padding: 2rem 1.5rem; }
.site-footer section + section { border-top: 2px solid #222; }

.footer-brand-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-site-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3bb1ff;
  margin-bottom: 0.4rem;
}
.footer-blurb {
  font-size: 0.9rem;
  color: #bbb;
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 0;
  word-break: break-word;
}

.footer-nav-section {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.footer-nav-dl {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.25rem 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  width: 100%;
}
.footer-nav-dl dt {
  padding: 0;
  min-width: 0;
}
.footer-nav-dl dt a {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0;
  min-height: 44px;
  word-break: break-word;
  transition: color 0.1s;
}
.footer-nav-dl dt a:hover { color: #3bb1ff; text-decoration: underline; }
.footer-nav-dl dd { display: none; }

.footer-trust-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.footer-trust-links a {
  color: #ff5252;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.footer-trust-links a:hover { color: #fff; }

.footer-legal {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.rg-notice {
  font-size: 0.82rem;
  color: #aaa;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  max-width: 800px;
  word-break: break-word;
}
.copyright {
  font-size: 0.82rem;
  color: #666;
  margin-bottom: 0;
}

/* ---------- Scroll-reveal micro animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .reveal.revealed {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Desktop (≥ 769px) ---------- */
@media (min-width: 769px) {
  .header-inner { padding: 0.5rem 2rem; }

  .nav-toggle { display: none; }
  .primary-nav {
    display: flex !important;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    flex: 1;
    overflow: visible;
    max-height: none;
    width: auto;
  }
  .nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    width: auto;
  }
  .nav-list li { border-bottom: none; }
  .nav-list a {
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    border: 2px solid transparent;
    min-height: auto;
  }
  .nav-list a:hover {
    background: #3bb1ff;
    border-color: #000;
    box-shadow: 3px 3px 0 #000;
  }

  .hero--home { flex-direction: row; min-height: 100vh; }
  .hero-copy {
    flex: 1;
    justify-content: center;
    align-items: flex-end;
    padding: 4rem 3rem 4rem 2rem;
  }
  .hero-media {
    width: 45%;
    min-height: auto;
  }

  .guide-hero-bar { padding: 3rem 2rem 2.5rem; }
  .inner-hero { padding: 3rem 2rem 2.5rem; }

  .wrap { padding: 0 2rem; }
  .content-section { padding: 3rem 0; }

  .footer-nav-section > div,
  .footer-nav-section > nav { max-width: 1200px; margin: 0 auto; }

  .site-footer section { padding: 2.5rem 2rem; }
}

/* ---------- Mobile (≤ 768px) ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .page-article {
    flex-direction: column;
  }
  .sidebar--left {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-bottom: 1.5rem;
    position: static;
    overflow-x: hidden;
  }
  .sidebar-inner {
    box-shadow: 4px 4px 0 #000;
    max-width: 100%;
    overflow-x: hidden;
  }

  .guide-hero-bar {
    flex-direction: column;
    padding: 1.5rem 1rem 1.25rem;
  }
  .guide-hero-media {
    width: 100%;
    max-width: 100%;
    box-shadow: 3px 3px 0 #000;
  }

  .inner-hero {
    padding: 1.5rem 1rem 1.25rem;
  }

  .hero-copy {
    padding: 2rem 1rem 1.5rem;
  }
  .hero-lead { font-size: 1rem; }

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

  .footer-nav-dl {
    grid-template-columns: 1fr;
    gap: 0;
  }

  main { padding-bottom: 5.5rem; }

  /* Ensure page-content tables don't overflow on mobile */
  .page-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .page-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: nowrap;
  }
  .page-content th,
  .page-content td {
    white-space: nowrap;
  }

  /* Ensure no single element bleeds past viewport */
  .page-content pre,
  .page-content code,
  .page-content img,
  .page-content iframe,
  .page-content video {
    max-width: 100%;
    overflow-x: auto;
  }

  .article-body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .content-section {
    overflow-x: hidden;
  }

  .wrap {
    padding: 0 0.75rem;
    overflow-x: hidden;
  }

  .footer-nav-dl dt a {
    font-size: 0.82rem;
  }
}

/* ---------- Very small (< 400px) ---------- */
@media (max-width: 399px) {
  .cta {
    font-size: 0.72rem;
    padding: 0.4rem 0.5rem;
    min-width: 56px;
    min-height: 44px;
  }
  h1 { font-size: 1.4rem; }
  .header-inner {
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
  }
  .brand-mark {
    width: 40px;
    height: 40px;
  }
  .nav-toggle {
    width: 44px;
    height: 44px;
  }
  .guide-hero-bar,
  .inner-hero {
    padding: 1.25rem 0.75rem 1rem;
  }
  .wrap {
    padding: 0 0.5rem;
  }
}

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