/* =====================================================
   Caribbean Startups — Universal static-page shell
   Shared by /pages/*.html and /resources/*.html
   Matches the React SPA nav, footer and Three.js scene
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ── Theme tokens ─────────────────────────────────── */
:root {
  --ns-bg:       #f4f7fc;
  --ns-bg2:      #e8effa;
  --ns-panel:    rgba(255,255,255,0.88);
  --ns-line:     rgba(37,99,235,0.18);
  --ns-text:     #0f172a;
  --ns-muted:    #475569;
  --ns-nav-bg:   rgba(255,255,255,0.86);
  --ns-tile-bg:  rgba(248,252,255,0.94);
  --ns-link:     #1d4ed8;
}
[data-theme='dark'] {
  --ns-bg:       #060b16;
  --ns-bg2:      #0f1d35;
  --ns-panel:    rgba(12,22,44,0.85);
  --ns-line:     rgba(122,175,246,0.22);
  --ns-text:     #ecf3ff;
  --ns-muted:    #94a3b8;
  --ns-nav-bg:   rgba(5,10,20,0.84);
  --ns-tile-bg:  rgba(8,16,30,0.85);
  --ns-link:     #7ab0ff;
}

/* ── Body theming for shell pages ─────────────────── */
/* Background lives on <html> so the fixed #ns-shell-canvas at
   z-index:-1 is visible through the transparent <body>.
   Per CSS painting order, z-index:-1 positioned elements paint
   AFTER the html background but BEFORE body content, making the
   Three.js scene visible through sections that lack their own bg. */
html:has(body.ns-shell-body) {
  background: var(--ns-bg);
  transition: background 0.25s ease;
}
/* .ns-shell-body is added by ns-shell.js in boot().
   Class + element selector (0,1,1) beats resource-styles.css
   body selector (0,0,1) even though ns-shell.css loads first. */
body.ns-shell-body {
  background: transparent !important;
  color: var(--ns-text);
  transition: color 0.25s ease;
}

/* ── Hide legacy shell elements ───────────────────── */
/* These exist in pages/*.html and are replaced by ns-shell.js.
   Scoped to body > * to avoid hiding content-level elements
   inside <main> (e.g. <footer> attribution lines in resource pages). */
nav.top-nav,
nav.ns-shell-nav,
body > #bg-canvas,
body > #ns-bg-canvas,
body > #progress-top {
  display: none !important;
}
/* Hide body-level footers only (not <footer> inside <main>) */
body > footer:not(#ns-shell-footer) {
  display: none !important;
}

/* ── Canvas background ─────────────────────────────── */
#ns-shell-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.52;
  pointer-events: none;
}

/* ── Nav bar ──────────────────────────────────────── */
#ns-shell-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid #1e3a8a;
  background: var(--ns-nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 4px 24px rgba(15,23,42,0.12);
}
.ns-nav-inner {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
}
.ns-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.ns-nav-brand:hover { transform: scale(1.03); }
.ns-nav-brand img {
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(37,99,235,0.32));
}
.ns-brand-text { line-height: 1.06; letter-spacing: -0.01em; }
.ns-brand-caribbean {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.88rem, 1.8vw, 1.18rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ns-brand-startups {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.88rem, 1.8vw, 1.18rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ns-brand-sub {
  display: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ns-muted);
  margin-top: 0.1rem;
}
@media (min-width: 520px) { .ns-brand-sub { display: block; } }

/* ── Primary nav links ─────────────────────────────── */
.ns-nav-links {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem;
  flex: 1;
  justify-content: center;
}
@media (min-width: 820px) { .ns-nav-links { display: flex; } }

.ns-nav-links a {
  border: 1.5px solid rgba(30,58,138,0.28);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ns-text);
  text-decoration: none;
  transition: all 0.18s ease;
}
.ns-nav-links a:hover {
  background: linear-gradient(90deg, #1d4ed8, #1e40af);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

/* ── More dropdown ─────────────────────────────────── */
.ns-nav-more { position: relative; }
.ns-nav-more-btn {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  border: 1.5px solid rgba(30,58,138,0.28);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ns-text);
  background: transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}
.ns-nav-more-btn:hover { background: rgba(30,58,138,0.1); }
.ns-nav-more-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 176px;
  border: 1px solid var(--ns-line);
  border-radius: 14px;
  background: var(--ns-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  overflow: hidden;
  z-index: 1001;
}
.ns-nav-more-menu.open { display: block; }
.ns-nav-more-menu a {
  display: block;
  padding: 0.52rem 1rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ns-text);
  text-decoration: none;
  transition: background 0.15s;
}
.ns-nav-more-menu a:hover { background: rgba(30,58,138,0.1); color: var(--ns-link); }

/* ── Nav tools ─────────────────────────────────────── */
.ns-nav-tools { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.ns-tool-btn {
  border: 1px solid var(--ns-line);
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ns-text);
  background: rgba(114,181,255,0.1);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.ns-tool-btn:hover { background: rgba(114,181,255,0.22); }

/* ── Hamburger ─────────────────────────────────────── */
.ns-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ns-line);
  border-radius: 10px;
  background: rgba(114,181,255,0.08);
  color: var(--ns-text);
  cursor: pointer;
  transition: background 0.15s;
}
.ns-hamburger:hover { background: rgba(114,181,255,0.2); }
@media (min-width: 820px) { .ns-hamburger { display: none; } }

/* ── Mobile menu ───────────────────────────────────── */
.ns-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid var(--ns-line);
  background: var(--ns-nav-bg);
  gap: 0.15rem;
}
.ns-mobile-menu.open { display: flex; }
.ns-mobile-menu a {
  display: block;
  padding: 0.5rem 0.7rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ns-text);
  text-decoration: none;
  border-radius: 10px;
  transition: background 0.15s;
}
.ns-mobile-menu a:hover { background: rgba(30,58,138,0.1); color: var(--ns-link); }

/* ── Footer ────────────────────────────────────────── */
#ns-shell-footer {
  border-top: 1px solid var(--ns-line);
  background: var(--ns-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 2.5rem 0 0;
  margin-top: 3rem;
  font-family: 'Poppins', sans-serif;
}
.ns-footer-inner {
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
}
.ns-footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.2fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ns-line);
}
@media (max-width: 900px) { .ns-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .ns-footer-grid { grid-template-columns: 1fr; } }

/* Brand column */
.ns-footer-brand-col {}
.ns-footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 800;
  text-decoration: none;
  margin-bottom: 0.6rem;
}
.ns-footer-brand-link img { width: 36px; height: 36px; }
.ns-footer-brand-name {
  background: linear-gradient(90deg, #1d4ed8, #16a34a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}
.ns-footer-tagline {
  font-size: 0.83rem;
  color: var(--ns-muted);
  max-width: 270px;
  line-height: 1.65;
  margin: 0 0 0.9rem;
}
.ns-footer-socials { display: flex; gap: 0.45rem; }
.ns-footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ns-line);
  border-radius: 999px;
  color: var(--ns-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s;
  opacity: 0.62;
  cursor: not-allowed;
}

/* Nav column */
.ns-footer-nav-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}
@media (max-width: 900px) { .ns-footer-nav-col { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .ns-footer-nav-col { grid-template-columns: repeat(3, 1fr); } }

.ns-footer-group h3 {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ns-text);
  margin: 0 0 0.6rem;
}
.ns-footer-group ul { list-style: none; padding: 0; margin: 0; }
.ns-footer-group li { margin: 0.28rem 0; }
.ns-footer-group a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ns-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.ns-footer-group a:hover { color: var(--ns-link); }

/* Newsletter column */
.ns-footer-newsletter-col {}
.ns-footer-newsletter-col h3 {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ns-text);
  margin: 0 0 0.45rem;
}
.ns-footer-newsletter-col p {
  font-size: 0.82rem;
  color: var(--ns-muted);
  margin: 0 0 0.7rem;
  line-height: 1.55;
}
.ns-news-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
@media (min-width: 480px) { .ns-news-form { flex-direction: row; } }
.ns-news-input-wrap { position: relative; flex: 1; }
.ns-news-input-wrap svg {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ns-muted);
  pointer-events: none;
}
.ns-news-form input {
  width: 100%;
  padding: 0.52rem 0.65rem 0.52rem 2.1rem;
  border: 1px solid var(--ns-line);
  border-radius: 12px;
  background: var(--ns-tile-bg);
  color: var(--ns-text);
  font: inherit;
  font-family: 'Poppins', sans-serif;
  font-size: 0.84rem;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.ns-news-form input:focus { outline: none; border-color: #2563eb; }
.ns-news-form button {
  padding: 0.52rem 0.95rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, #1d4ed8, #047857);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.15s;
}
.ns-news-form button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ns-news-subscribed {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(22,163,74,0.3);
  background: rgba(22,163,74,0.06);
  color: #15803d;
  padding: 0.52rem 0.75rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
}
[data-theme='dark'] .ns-news-subscribed { color: #4ade80; background: rgba(22,163,74,0.12); }

/* Footer bottom */
.ns-footer-bottom {
  padding: 1.1rem 0 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}
.ns-footer-copyright {
  font-size: 0.8rem;
  color: var(--ns-muted);
  margin: 0;
}
.ns-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.ns-footer-legal a {
  font-size: 0.76rem;
  color: var(--ns-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.ns-footer-legal a:hover { color: var(--ns-link); }

/* ── Scroll-to-top ─────────────────────────────────── */
#ns-scroll-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(122,176,247,0.38);
  border-radius: 999px;
  background: rgba(7,14,28,0.88);
  color: #eaf2ff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  transition: opacity 0.22s ease, border-color 0.15s;
  pointer-events: none;
}
#ns-scroll-top.is-visible { opacity: 1; pointer-events: auto; }
[data-theme='light'] #ns-scroll-top,
:root:not([data-theme='dark']) #ns-scroll-top {
  background: rgba(255,255,255,0.94);
  color: #12355e;
  border-color: rgba(37,99,235,0.24);
}
#ns-scroll-top svg { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
#ns-scroll-top .ns-ring-bg { stroke: rgba(122,176,247,0.2); stroke-width: 3; fill: none; }
#ns-scroll-top .ns-ring { stroke: #7ab0ff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-dasharray: 138.2; stroke-dashoffset: 138.2; transition: stroke-dashoffset 0.12s linear; }
#ns-scroll-top:hover { border-color: #9ec8ff; }
.ns-scroll-arrow { font-size: 1.15rem; line-height: 1; }

/* ── Utility ────────────────────────────────────────── */
.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;
}

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

/* ── Focus ring ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid #7ab0ff;
  outline-offset: 2px;
  border-radius: 6px;
}
