/* ============================================================
   Nanonets site chrome (header + footer)
   Ported 1:1 from the new-website Navbar.tsx / Footer.tsx.
   Tailwind design tokens are translated to plain CSS here so the
   Ghost theme renders the exact same header/footer as the site.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap');

:root {
  --nn-background: #f0f0f0;
  --nn-foreground: #131315;
  --nn-card: #ffffff;
  --nn-primary: #546FFF;
  --nn-primary-dark: #3A4DB2;
  --nn-muted: #222222;
  --nn-muted-light: #6b6b6b;
  --nn-border: #c9c6c2;
  --nn-surface: #f5f3f0;
  --nn-surface-dark: #131315;
}

.nn-nav, .nn-nav *,
.nn-footer, .nn-footer * { box-sizing: border-box; }

/* ============================================================
   HEADER
   ============================================================ */

.nn-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(240, 240, 240, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.nn-nav .nn-reading-progress {
  display: block;
  width: 100%;
  height: 3px;
  border: none;
  background: transparent;
  position: absolute;
  bottom: 0;
  left: 0;
}
.nn-nav .nn-reading-progress::-webkit-progress-bar { background: transparent; }
.nn-nav .nn-reading-progress::-webkit-progress-value { background: var(--nn-primary); }
.nn-nav .nn-reading-progress::-moz-progress-bar { background: var(--nn-primary); }

.nn-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
}

.nn-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.nn-nav-left {
  display: flex;
  align-items: center;
  gap: 48px;
}

.nn-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  text-decoration: none;
  /* Neutralise a leaked `.nn-logo { margin-bottom }` rule from style.css
     (an unrelated "demo" component) that pushed the nav logo upward,
     especially on mobile (margin-bottom: 40px in its mobile media query). */
  margin: 0;
}
.nn-logo img { height: 32px; width: auto; display: block; }
.nn-logo span {
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--nn-foreground);
}
@media (max-width: 1023px) {
  .nn-logo img { height: 28px; }
  .nn-logo span { font-size: 18px; }
}

.nn-nav-links { display: none; align-items: center; }
@media (min-width: 1024px) { .nn-nav-links { display: flex; } }

.nn-nav-item { position: relative; }

.nn-nav-item > .nn-nav-link {
  font-size: 14px;
  font-weight: 400;
  color: var(--nn-foreground);
  padding: 4px 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.nn-nav-item > .nn-nav-link:hover { color: var(--nn-muted-light); }

.nn-caret { margin-top: 1px; transition: transform 0.2s; }
.nn-nav-item:hover .nn-caret { transform: rotate(180deg); }

/* Dropdown shell (matches absolute top-full pt-3) */
.nn-dropdown {
  position: absolute;
  top: 100%;
  padding-top: 12px;
  display: none;
}
.nn-nav-item:hover .nn-dropdown { display: block; }
.nn-dropdown.nn-align-left { left: 0; }
.nn-dropdown.nn-align-center { left: 50%; transform: translateX(-50%); }
.nn-dropdown.nn-w-680 { width: 680px; }
.nn-dropdown.nn-w-720 { width: 720px; }

.nn-dropdown-panel {
  background: var(--nn-card);
  border: 1px solid var(--nn-border);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

/* Sectioned dropdown (Products / Solutions) */
.nn-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.nn-section:not(:last-child) { border-right: 1px solid var(--nn-border); }

.nn-section-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nn-primary);
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  border-bottom: 1px solid var(--nn-border);
  text-decoration: none;
}
a.nn-section-title { transition: background 0.15s; }
a.nn-section-title:hover { background: rgba(19, 19, 21, 0.04); }
.nn-section-title .nn-arrow {
  opacity: 0;
  transform: translateX(-2px);
  transition: all 0.2s;
  flex-shrink: 0;
}
a.nn-section-title:hover .nn-arrow { opacity: 1; transform: translateX(0); }

.nn-section-list {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.nn-child {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  text-decoration: none;
  transition: background 0.15s;
}
.nn-child:hover { background: rgba(19, 19, 21, 0.04); }
.nn-bullet {
  width: 4px;
  height: 4px;
  flex-shrink: 0;
  background: rgba(19, 19, 21, 0.2);
  transition: background 0.15s;
}
.nn-child:hover .nn-bullet { background: var(--nn-primary); }
.nn-child-label { font-size: 13px; color: var(--nn-foreground); }

.nn-badge {
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(84, 111, 255, 0.1);
  color: var(--nn-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  line-height: 1;
}

/* Grid dropdown (Resources) */
.nn-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.nn-grid-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--nn-border);
  border-right: 1px solid var(--nn-border);
  text-decoration: none;
  transition: background 0.15s;
}
.nn-grid-item:hover { background: rgba(19, 19, 21, 0.03); }
.nn-grid-item.nn-full { grid-column: 1 / -1; border-right: none; }
.nn-grid-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--nn-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nn-muted-light);
  margin-top: 2px;
}
.nn-grid-text { min-width: 0; }
.nn-grid-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--nn-foreground);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nn-grid-desc { font-size: 12px; color: var(--nn-muted-light); line-height: 1.5; }

/* Right-side actions */
.nn-nav-right { display: none; align-items: center; gap: 8px; flex-shrink: 0; }
@media (min-width: 1024px) { .nn-nav-right { display: flex; } }

.nn-btn-demo {
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  background: var(--nn-primary);
  border: 1px solid var(--nn-primary);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.nn-btn-demo:hover { background: var(--nn-primary-dark); }
.nn-btn-demo svg { margin-left: 6px; }

.nn-btn-start {
  font-size: 15px;
  font-weight: 400;
  color: var(--nn-foreground);
  background: var(--nn-card);
  border: 1px solid var(--nn-border);
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s;
}
.nn-btn-start:hover { background: rgba(19, 19, 21, 0.04); }
.nn-btn-start svg { margin-top: 1px; }

/* Mobile toggle */
.nn-mobile-toggle {
  display: block;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
@media (min-width: 1024px) { .nn-mobile-toggle { display: none; } }
.nn-mobile-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--nn-foreground);
  transition: all 0.2s;
}
.nn-mobile-toggle span + span { margin-top: 6px; }
.nn-mobile-toggle.nn-open span:nth-child(1) { transform: rotate(45deg) translate(4px, 5px); }
.nn-mobile-toggle.nn-open span:nth-child(2) { opacity: 0; }
.nn-mobile-toggle.nn-open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -5px); }

/* Mobile menu */
.nn-mobile-menu {
  display: none;
  background: var(--nn-card);
  border-bottom: 1px solid var(--nn-border);
  padding: 4px 24px 28px;
  max-height: calc(100vh - 74px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nn-mobile-menu.nn-open { display: block; }
@media (min-width: 1024px) { .nn-mobile-menu.nn-open { display: none; } }

.nn-m-block { padding: 18px 0; }
.nn-m-block + .nn-m-block { border-top: 1px solid var(--nn-border); }

.nn-m-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--nn-foreground);
  padding: 4px 0;
  text-decoration: none;
  transition: color 0.15s;
}
.nn-m-link:active { color: var(--nn-primary); }

.nn-m-section {
  margin-top: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--nn-border);
}
.nn-m-section + .nn-m-section { margin-top: 18px; }

.nn-m-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nn-primary);
  margin-bottom: 10px;
  padding: 2px 0;
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.nn-m-caret {
  flex-shrink: 0;
  color: var(--nn-primary);
  transition: transform 0.2s ease;
}

/* Collapsible sub-sections: collapsed by default, expand on tap */
.nn-m-collapsible:not(.nn-m-open) .nn-m-child { display: none; }
.nn-m-collapsible:not(.nn-m-open) .nn-m-section-title { margin-bottom: 0; }
.nn-m-collapsible.nn-m-open .nn-m-caret { transform: rotate(180deg); }

.nn-m-child {
  display: block;
  font-size: 15px;
  color: var(--nn-muted);
  padding: 7px 0;
  text-decoration: none;
  transition: color 0.15s;
}
.nn-m-child:hover,
.nn-m-child:active { color: var(--nn-primary); }

.nn-m-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nn-m-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: var(--nn-primary);
  border: 1px solid var(--nn-primary);
  padding: 13px 20px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.nn-m-demo:active { background: var(--nn-primary-dark); }
.nn-m-start {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  color: var(--nn-foreground);
  background: var(--nn-card);
  border: 1px solid var(--nn-border);
  padding: 13px 20px;
  text-align: center;
  text-decoration: none;
  margin-top: 0;
  transition: background 0.15s;
}
.nn-m-start:active { background: rgba(19, 19, 21, 0.04); }

/* ============================================================
   FOOTER
   ============================================================ */

.nn-footer {
  background: var(--nn-surface-dark);
  border-top: 1px solid #262626;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.nn-footer-inner { padding: 48px 20px 32px; }
@media (min-width: 640px) { .nn-footer-inner { padding: 56px 32px 32px; } }
@media (min-width: 1024px) { .nn-footer-inner { padding: 56px 56px 32px; } }

.nn-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
@media (min-width: 640px) { .nn-footer-grid { gap: 40px; } }
@media (min-width: 768px) { .nn-footer-grid { grid-template-columns: repeat(6, 1fr); } }

.nn-footer-brand { grid-column: span 2; }
.nn-footer-logo { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; }
.nn-footer-logo img { height: 32px; width: auto; }
.nn-footer-logo span { font-size: 18px; font-weight: 500; color: rgba(255, 255, 255, 0.8); }
.nn-footer-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.25);
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 220px;
}
.nn-footer-badges { display: flex; gap: 8px; }
.nn-footer-badge {
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  color: rgba(255, 255, 255, 0.2);
}

.nn-footer-col-title {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 16px;
}
.nn-footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nn-footer-link {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  transition: color 0.15s;
}
.nn-footer-link:hover { color: rgba(255, 255, 255, 0.7); }
.nn-footer-addr { font-size: 13px; color: rgba(255, 255, 255, 0.35); line-height: 1.6; }

.nn-footer-bottom {
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
@media (min-width: 768px) { .nn-footer-bottom { flex-direction: row; } }
.nn-footer-copy { font-size: 12px; color: rgba(255, 255, 255, 0.15); }
.nn-footer-legal { display: flex; gap: 20px; }
.nn-footer-legal a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.15);
  text-decoration: none;
  transition: color 0.15s;
}
.nn-footer-legal a:hover { color: rgba(255, 255, 255, 0.3); }
