/* ============================================================
   PODRONES /NANOHUB — HOME (marketing landing) SCOPED STYLES
   ------------------------------------------------------------
   Reproduces the Claude Design "NanoHub" landing artifact
   (nanohub/NanoHub.dc.html) as a plain, self-contained page that
   renders inside the STANDARD Podrones site chrome (headerphp /
   headermain / headerbody + podronesfooter).

   The original artifact was built on the Claude Design framework
   (<x-dc>, DCLogic, {{ }} bindings, <image-slot>) whose runtime is
   not part of this site. This stylesheet + nanohub-home.js replace
   that runtime with plain CSS classes and vanilla JS.

   EVERYTHING here is scoped under `.nh-home` so the artifact's blue /
   Fraunces look never leaks into — or is clobbered by — the site
   header/footer CSS (css/style.css, css/podrones.css, ...). The
   artifact's bare `a{}` override is intentionally dropped for the same
   reason; link colours are re-scoped under `.nh-home` below.

   The ONE deliberate exception to the scoping rule is the page
   background (`--nh-page-bg`, applied to <body> and the shared site
   `#header` below). This stylesheet is only ever linked from the
   /nanohub pages, so those global rules cannot reach the rest of the
   site — the same trade-off /d2c makes with its `--paper` tone.
   ============================================================ */

/* ------------------------------------------------------------
   PAGE BACKGROUND — warm greige (Claude Design: #F5F1EA / #E8E1D6).
   The pair is a light surface and its rule/border tone; both are
   tokenised below.

   Defined on :root (not .nh-home) because <body> and the shared site
   header both need to read it.
   ------------------------------------------------------------ */
:root {
  --nh-page-bg:  #F5F1EA;  /* light greige surface */
  --nh-page-rule:#E8E1D6;  /* its darker partner — rules and borders */

  /* Tone of the site header — see the CARDINAL RULE block below. The
     greige default suits a page whose first band is the greige stripe
     (3pl.php, vending.php); the :has() rule flips it for pages that
     open on the white stripe (index.php). */
  --nh-header-bg: var(--nh-page-bg);
}

body { background: var(--nh-page-bg); }

/* ------------------------------------------------------------
   CARDINAL RULE — the site header ALWAYS carries the same background
   as the page's FIRST band. Any disagreement makes the header read as
   a detached strip floating above the content.

   Rather than hand-setting the tone per page (which silently rots the
   moment a page re-stripes its bands — and did, when index.php's hero
   went from greige to white while 3pl.php and vending.php, sharing this
   stylesheet, kept their greige heros), the tone is DERIVED from the
   first band: `.nh-home > section:first-of-type` is that band, and
   `.nh-band-warm` on it means greige. So a page fixes its own header
   just by striping its bands, and any new /nanohub page inherits the
   rule for free.

   :has() is baseline in every current browser; where it is missing the
   selector is dropped and the header falls back to the greige default —
   still correct for the two pages that open greige.

   !important is required throughout: the theme's sticky/scroll class
   swaps re-assert their own background on #header / .header-inner as
   the user scrolls, as do its `.dark` and `.header-colored` variants. */
body:has(.nh-home > section:first-of-type:not(.nh-band-warm)) {
  --nh-header-bg: #FFFFFF;   /* first band is the white stripe */
}
#header,
#header .header-inner {
  background-color: var(--nh-header-bg) !important;
}

/* ------------------------------------------------------------
   SECTION STRIPES
   ------------------------------------------------------------
   The site theme paints EVERY <section> white (css/style.css:121
   `section { background-color: #ffffff }`). That rule beats the
   <body> background, so without the override below the page colour
   only ever shows through the header — which is exactly the seam
   that made the tinted header look detached from the white content
   under it.

   The page alternates: white stripe, greige stripe, white, greige …
   The first band under the header is white so the header reads as part
   of it rather than as a separate strip (see the #header rule above).

   Band order and tone:
     hero            white
     five audiences  greige
     four capabilities  white
     problem         greige
     closing CTA     white
     client ribbon   white   ← the one doubled-up seam; the ribbon must
                               stay white for its white-background JPEG
                               logos, so it carries a hairline rule
                               instead of a tone change.
     counters        (site theme's own dark parallax band)

   `:not(.background-overlay)` leaves the shared counters component
   alone — that band carries its own parallax image and dark overlay
   from the site theme, and must not be repainted here.
   ------------------------------------------------------------ */
.nh-home > section:not(.background-overlay) {
  background-color: #FFFFFF;   /* the white stripe */
}
.nh-home > section.nh-band-warm {
  background-color: var(--nh-page-bg);   /* the greige stripe */
}

/* ------------------------------------------------------------
   Design tokens (from the artifact's inline palette). Kept as
   CSS variables so the four capability accents stay in one place.
   ------------------------------------------------------------ */
.nh-home {
  /* Ink — warmed off pure neutral so text sits in the greige palette
     rather than on top of it. --nh-ink-faint is darker than the
     artifact's #888888, which was borderline on the greige stripe. */
  --nh-ink:        #14110C;
  --nh-ink-2:      #302B22;
  --nh-ink-mute:   #5A5347;
  --nh-ink-faint:  #6E6559;
  /* Rules and borders both take the greige pair's darker tone. */
  --nh-line:       var(--nh-page-rule);
  --nh-line-2:     var(--nh-page-rule);
  /* Card/tile fill. White: on a greige stripe the card lifts off the
     page, and on a white stripe it is defined by its border instead. */
  --nh-surface:    #FFFFFF;
  --nh-blue:       #0F6BAE;
  --nh-blue-d:     #0A4E86;

  /* Per-capability accents (artifact `capColors`) */
  --nh-cap-0: #0F6BAE;
  --nh-cap-1: #2E86D1;
  --nh-cap-2: #0A5490;
  --nh-cap-3: #4B9FDB;

  font-family: 'Satoshi', 'Inter', system-ui, sans-serif;
  color: var(--nh-ink);
  overflow-x: hidden;
}

/* Scoped link colours (replaces the artifact's global `a{}` rule). */
.nh-home a { color: var(--nh-blue); text-decoration: none; }
.nh-home a:hover { color: var(--nh-blue-d); }

/* Display serif used throughout the artifact. */
.nh-home .nh-serif { font-family: 'Fraunces', Georgia, serif; }

/* ------------------------------------------------------------
   Keyframes (moved verbatim from the artifact <style> block).
   ------------------------------------------------------------ */
@keyframes nh-hub-pulse {
  0%, 100% { box-shadow: 0 22px 48px -14px rgba(15, 107, 174, 0.5); }
  50%      { box-shadow: 0 22px 60px -8px rgba(15, 107, 174, 0.75); }
}
.nh-home .nh-hub { animation: nh-hub-pulse 3.2s ease-in-out infinite; }

/* ------------------------------------------------------------
   Image-slot placeholders (replace the artifact's <image-slot>
   custom elements — those need the Claude Design runtime). A
   captioned tile that can later be swapped for a real <img>.
   ------------------------------------------------------------ */
.nh-home .nh-image-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: repeating-linear-gradient(
      -45deg, #F2EDE4, #F2EDE4 12px, #E9E2D6 12px, #E9E2D6 24px);
  border: 1px solid var(--nh-line-2);
  color: var(--nh-ink-faint);
  font-size: 12.5px;
  line-height: 1.5;
  padding: 16px;
  box-sizing: border-box;
}
.nh-home .nh-image-slot span {
  max-width: 80%;
  font-weight: 500;
}

/* ------------------------------------------------------------
   CLIENT LOGO RIBBON — the shared site carousel (js/functions.js
   turns `.carousel` into an Owl carousel), reused here in place of
   the artifact's text marquee.

   Only presentation is set below; the motion comes from the theme.
   Logos ship at mixed sizes and aspect ratios, so each slide is a
   fixed-height flex box that letterboxes its mark — that keeps the
   ribbon's baseline steady as slides scroll through.
   ------------------------------------------------------------ */
/* Each slide is `div > a > img` (the component's markup, matching the
   home page). Centre at every level so the mark sits mid-band whatever
   its aspect ratio.

   CAREFUL with the selectors here. Owl rebuilds the DOM on init:

       before:  .nh-ribbon > div                        (the slides)
       after:   .nh-ribbon > .owl-stage-outer
                            > .owl-stage
                            > .owl-item > div           (the slides)

   so a bare `.nh-ribbon > div` matches the SLIDES before init and
   `.owl-stage-outer` after it — which turns the scrolling viewport into
   a 64px centred flex box and stops the carousel dead. Hence the
   `:not(.owl-carousel)` guard: style the raw slides only while the
   ribbon is un-initialised, and go through `.owl-item` once it is. */
.nh-home .nh-ribbon:not(.owl-carousel) > div,
.nh-home .nh-ribbon .owl-item > div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}
.nh-home .nh-ribbon a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.nh-home .nh-ribbon img {
  max-height: 46px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
/* Soften the ribbon's entry/exit the way the artifact's marquee did,
   so slides fade at the edges instead of being cut off mid-logo. */
.nh-home .nh-ribbon {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

/* ============================================================
   CAPABILITY CARDS — replaces {{ cardStyleN }} bindings.
   Base + .is-active states ported from DCLogic cardBase/cardActive.
   The accent colour comes from the per-card --cap-color variable.
   ============================================================ */
.nh-home .nh-cap-card {
  /* Cards are now <a> links to each capability's landing page
     (01 → /podbanks/, 02 → /nanohub/vending.php, 03 → /d2c/,
     04 → /nanohub/3pl.php), so: block display, ink text (not link
     blue) and a pointer cursor. */
  display: block;
  background: #FFFFFF;
  border: 0.5px solid var(--nh-line-2);
  border-radius: 8px;
  padding: 28px 26px;
  color: var(--nh-ink);
  cursor: pointer;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
/* Keep ink text on hover too — .nh-home a:hover would otherwise win. */
.nh-home .nh-cap-card:hover { color: var(--nh-ink); }
.nh-home .nh-cap-card.is-active {
  border-color: var(--cap-color);
  box-shadow: 0 18px 36px -16px color-mix(in srgb, var(--cap-color) 33%, transparent);
  transform: translateY(-4px) scale(1.015);
}

/* ============================================================
   ORBIT DIAGRAM — nodes, connecting lines, badges.
   Replaces {{ nodeStyleN }} / {{ lineStyleN }} / {{ badgeStyleN }}.
   ============================================================ */
.nh-home .nh-orbit-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--nh-page-rule);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--nh-ink);
  box-shadow: 0 12px 28px -14px rgba(10, 10, 10, 0.14);
  transition: box-shadow 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
  /* Nodes are now <a> links (same targets as the capability cards). */
  cursor: pointer;
  white-space: nowrap;
}
/* Keep ink text on hover too — .nh-home a:hover would otherwise win. */
.nh-home .nh-orbit-node:hover { color: var(--nh-ink); }
.nh-home .nh-orbit-node.is-active {
  border: 1.5px solid var(--cap-color);
  box-shadow: 0 22px 44px -14px color-mix(in srgb, var(--cap-color) 47%, transparent);
  transform: scale(1.1);
  z-index: 3;
}
/* Corner positions (artifact `nodePositions`). */
.nh-home .nh-orbit-node.nh-pos-0 { left: 2%;  top: 2%; }
.nh-home .nh-orbit-node.nh-pos-1 { right: 2%; top: 2%; }
.nh-home .nh-orbit-node.nh-pos-2 { left: 2%;  bottom: 2%; }
.nh-home .nh-orbit-node.nh-pos-3 { right: 2%; bottom: 2%; }

.nh-home .nh-orbit-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #EAF2FA;
  flex-shrink: 0;
  transition: background 0.35s ease;
}
.nh-home .nh-orbit-node.is-active .nh-orbit-badge {
  /* ~12% tint of the accent (artifact badgeActive `${c}1F`). */
  background: color-mix(in srgb, var(--cap-color) 12%, transparent);
}

.nh-home .nh-orbit-line {
  stroke: var(--nh-blue);
  stroke-width: 0.6;
  stroke-dasharray: 2 1.6;
  opacity: 0.55;
  transition: stroke 0.35s ease, stroke-width 0.35s ease, opacity 0.35s ease;
}
.nh-home .nh-orbit-line.is-active {
  stroke: var(--cap-color);
  stroke-width: 1.4;
  stroke-dasharray: none;
  opacity: 1;
}

/* ------------------------------------------------------------
   Responsive rules (moved verbatim from the artifact @media
   block, re-scoped under .nh-home). The DC nav/hamburger rules
   are dropped — the standard site header owns responsive nav.
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .nh-home .nh-cap-grid   { grid-template-columns: 1fr !important; }
  .nh-home .nh-tile-grid  { grid-template-columns: 1fr !important; }
  .nh-home .nh-stats-row  {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 32px !important;
  }
  .nh-home .nh-tileE-img-wrap { display: none !important; }
  .nh-home .nh-footer-row {
    flex-direction: column !important;
    gap: 14px !important;
    align-items: flex-start !important;
  }
  .nh-home .nh-section-pad {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }
}
