/* ==========================================================================
   Vidda Site Shell — shared layout & components
   --------------------------------------------------------------------------
   Loaded after tokens.css on every page. Holds everything that appears on
   more than one page (banner, nav, subnav, cards, tables, footer) so pages only carry their own content.

   Per-page knobs (set on :root in the page's <style>):
     --subnav-max        width of the in-page subnav pill row
     --hero-h1-mobile    hero <h1> size below 1040px
     --section-pad-mobile  padding for .ns-section-pad below 1040px
   ========================================================================== */

* { box-sizing: border-box; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); font-family: var(--font-sans); color: var(--fg1); }
a { color: var(--brand); }
a:hover { color: var(--brand-bright); }
::selection { background: var(--beacon-200); }

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.ns-container { max-width: 1120px; margin: 0 auto; }
.ns-scroll-anchor { scroll-margin-top: 140px; }

/* --------------------------------------------------------------------------
   TEASER BANNER
   -------------------------------------------------------------------------- */
.ns-banner { background: var(--harbor-800); color: var(--fg-on-brand); }
.ns-banner-inner { padding: 10px 32px; display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; text-align: center; }
.ns-banner-icon { width: 14px; height: 14px; flex: none; color: var(--beacon-300); }
.ns-banner-text { font-family: var(--font-sans); font-size: 13.5px; line-height: 1.4; }
.ns-banner-text strong { font-weight: 700; }
.ns-banner-text a { color: var(--beacon-300); font-weight: 600; text-decoration: underline; }

/* --------------------------------------------------------------------------
   HEADER / NAV
   -------------------------------------------------------------------------- */
.ns-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.ns-header-inner { padding: 0 32px; display: flex; align-items: center; height: 68px; gap: 28px; }
.ns-header-logo { display: flex; align-items: center; }
.ns-header-logo img { height: 42px; width: auto; }
.ns-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ns-nav { display: flex; gap: 26px; margin-left: 18px; }
.ns-link { text-decoration: none; color: var(--fg2); font-family: var(--font-sans); font-weight: 500; font-size: 14.5px; transition: color var(--dur-fast); white-space: nowrap; }
.ns-link:hover { color: var(--fg1); }
.ns-link.is-current { color: var(--fg1); font-weight: 700; }

.ns-cta { text-decoration: none; font-family: var(--font-sans); font-weight: 600; border-radius: var(--radius-md); display: inline-flex; align-items: center; white-space: nowrap; transition: background var(--dur-fast); }
.ns-cta-sm { font-size: 14.5px; padding: 10px 18px; gap: 8px; }
.ns-cta-lg { font-size: 16px; padding: 13px 24px; gap: 9px; }
.ns-cta-primary { background: var(--brand); color: var(--fg-on-brand); }
.ns-cta-primary:hover { background: var(--brand-hover); }
.ns-cta-ghost { background: transparent; color: var(--fg1); border: 1px solid var(--border-strong); }
.ns-cta-ghost:hover { background: var(--surface-2); }
.ns-cta-accent { background: var(--accent); color: var(--fg-on-accent); }
.ns-cta-accent:hover { background: var(--accent-hover); }

.ns-menu-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg1); cursor: pointer; flex: none; padding: 0; }
.ns-menu-toggle:hover { background: var(--surface-2); }
.ns-mobile-menu { display: none; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--border); }
.ns-mobile-menu.is-open { display: flex; }
.ns-mobile-link { text-decoration: none; color: var(--fg1); font-family: var(--font-sans); font-weight: 600; font-size: 15.5px; padding: 15px 32px; border-bottom: 1px solid var(--border); }
.ns-mobile-link:last-child { border-bottom: none; }

/* --------------------------------------------------------------------------
   IN-PAGE SUBNAV
   -------------------------------------------------------------------------- */
.ns-subnav { position: sticky; top: 68px; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.ns-subnav-wrap { padding: 16px 32px; display: flex; justify-content: center; }
.ns-subnav-inner { display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--surface-2); border-radius: var(--radius-pill); padding: 6px; width: 100%; max-width: var(--subnav-max, 560px); }
.subnav-link { text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 10px 18px; border-radius: var(--radius-pill); white-space: nowrap; flex: 1; text-align: center; background: transparent; color: var(--fg2); transition: background var(--dur-fast), color var(--dur-fast); }
.subnav-link.is-active { background: var(--brand); color: var(--fg-on-brand); }

/* --------------------------------------------------------------------------
   TYPE
   -------------------------------------------------------------------------- */
.ns-eyebrow-on-dark { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--beacon-300); }
.ns-section-title { font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: -.02em; color: var(--fg1); margin: 12px 0 0; }
.ns-section-title--lg { font-size: 38px; }
.ns-balance { text-wrap: balance; }
.ns-section-lead { font-size: 15.5px; line-height: 1.65; color: var(--fg2); margin: 0 0 28px; max-width: 960px; }

/* --------------------------------------------------------------------------
   CARDS
   -------------------------------------------------------------------------- */
.ns-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 26px; box-shadow: var(--shadow-sm); }
.ns-card--sm { border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-xs); }
.ns-card--xs { border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-xs); }
.ns-card-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.ns-card-head--tight { gap: 10px; }
.ns-card-icon { width: 44px; height: 44px; flex: none; border-radius: var(--radius-md); background: var(--harbor-50); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; }
.ns-card-title { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; color: var(--fg1); margin: 0; }
.ns-card-text { font-size: 15px; line-height: 1.6; color: var(--fg2); margin: 0; }
.ns-card-text--sm { font-size: 13.5px; line-height: 1.55; }
.ns-card-kicker { font-weight: 600; font-size: 14.5px; margin: 12px 0 5px; color: var(--fg1); }
.ns-card-glyph { width: 19px; height: 19px; color: var(--secondary); }
.ns-list-icon { width: 20px; height: 20px; color: var(--brand); flex: none; }

.ns-feature-list { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.ns-feature-list li { font-size: 13.5px; line-height: 1.55; color: var(--fg2); }

/* --------------------------------------------------------------------------
   TABLES (CSS-table layout, horizontally scrollable on small screens)
   -------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }
.ns-table { display: table; width: 100%; border-collapse: collapse; --th-pad: 14px 20px; --td-pad: 14px 20px; }
.ns-table--framed { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); }
.ns-table-head { display: table-row; background: var(--surface-2); }
.ns-table-row { display: table-row; }
.ns-th { display: table-cell; padding: var(--th-pad); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg3); font-weight: 600; border-bottom: 1px solid var(--border); text-align: left; }
.ns-th--brand { color: var(--brand); }
.ns-th--right { text-align: right; }
.ns-td { display: table-cell; padding: var(--td-pad); border-bottom: 1px solid var(--border); font-size: 13.5px; color: var(--fg2); }
.ns-td--label { font-weight: 600; font-size: 14px; color: var(--fg1); }
.ns-td--highlight { color: var(--fg1); background: var(--harbor-50); }
.ns-td--price { font-family: var(--font-mono); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; color: var(--brand); }

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.ns-footer { background: var(--harbor-900); color: rgba(244, 251, 252, 0.7); }
.ns-footer-inner { padding: 40px 32px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.ns-footer-logo { height: 24px; }
.ns-footer-copy { font-family: var(--font-mono); font-size: 11.5px; color: rgba(244, 251, 252, 0.45); }
.ns-footer-links { display: flex; align-items: center; gap: 16px; font-family: var(--font-mono); font-size: 11.5px; }
.ns-footer-links a, .ns-footer-links button { color: rgba(244, 251, 252, 0.7); font-family: inherit; font-size: inherit; }
.ns-footer-links button { background: none; border: none; padding: 0; cursor: pointer; text-decoration: underline; }
.ns-footer-links a:hover, .ns-footer-links button:hover { color: var(--fg-on-brand); }

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1040px) {
  .ns-hide-mobile { display: none !important; }
  .ns-grid-2 { grid-template-columns: 1fr !important; }
  .ns-grid-3 { grid-template-columns: 1fr !important; }
  .ns-grid-4 { grid-template-columns: 1fr !important; }
  .ns-hero-h1 { font-size: var(--hero-h1-mobile, 40px) !important; }
  .ns-section-pad { padding: var(--section-pad-mobile, 48px 20px) !important; }
  .ns-menu-toggle { display: inline-flex; }
  .ns-subnav-wrap { padding: 12px 16px !important; }
  .ns-subnav-inner { flex-wrap: wrap !important; justify-content: center !important; max-width: 100% !important; gap: 6px !important; }
  .ns-subnav-inner .subnav-link { flex: none !important; padding: 8px 14px !important; font-size: 12.5px !important; }
}

/* --------------------------------------------------------------------------
   HOME — engagement rail (how-it-works steps)
   -------------------------------------------------------------------------- */
.rail-step { display: flex; flex-direction: column; gap: 14px; padding: 30px 28px; }
.rail-divider { border-left: 1px solid var(--border); position: relative; }
.rail-num { width: 40px; height: 40px; border-radius: 50%; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.rail-arrow { position: absolute; left: -30px; top: 50%; transform: translateY(-50%); color: var(--brand); font-size: 56px; font-weight: 700; line-height: 1; background: var(--surface); z-index: 1; }
.rail-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg3); font-weight: 600; }
.rail-title { font-family: var(--font-display); font-weight: 700; font-size: 21px; color: var(--fg1); letter-spacing: -.01em; margin-top: 8px; }

/* --------------------------------------------------------------------------
   HOME — "what usually goes wrong" issue list
   -------------------------------------------------------------------------- */
.issue { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.issue:last-child { border-bottom: none; }
.issue-num { font-family: var(--font-mono); font-size: 13px; color: var(--beacon-500); font-weight: 600; flex: none; width: 28px; }
.issue-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--fg1); }
.issue-text { font-size: 15px; line-height: 1.55; color: var(--fg2); margin-top: 6px; }

/* --------------------------------------------------------------------------
   HOME — "how Vidda is different" cards
   -------------------------------------------------------------------------- */
.diff-card { border-top: 2px solid var(--beacon-400); padding-top: 18px; }
.diff-title { font-family: var(--font-display); font-weight: 600; font-size: 21px; margin: 0 0 8px; }
.diff-text { font-size: 15px; line-height: 1.6; color: rgba(244, 251, 252, 0.78); }

@media (max-width: 1040px) {
  .rail-divider { border-left: 0 !important; border-top: 1px solid var(--border); }
  .rail-arrow { display: none !important; }
}

/* --------------------------------------------------------------------------
   D365 WMS PAGE — integration architecture diagram
   -------------------------------------------------------------------------- */
.arch-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.arch-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.arch-title { font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -.01em; margin: 0; color: var(--fg1); }
.arch-text { font-size: 14.5px; line-height: 1.55; color: var(--fg2); margin: 0; }
.arch-row { display: flex; gap: 10px; flex-wrap: wrap; }
.arch-chip { flex: 1; min-width: 110px; border-radius: var(--radius-md); padding: 12px 14px; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.arch-chip--harbor { background: var(--harbor-50); border: 1px solid var(--harbor-200); color: var(--harbor-700); }
.arch-chip--pine { background: var(--pine-50); border: 1px solid var(--pine-200); color: var(--pine-700); padding: 12px 10px; font-size: 13px; }
.arch-hub { display: flex; justify-content: center; align-items: center; padding: 2px 0; }
.arch-hub > div { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.arch-hub-icon { width: 20px; height: 20px; color: var(--fg-on-brand); stroke-width: 2.25; }
.arch-flow-label { text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.arch-io { flex: 1; min-width: 180px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.arch-io-head { display: flex; align-items: center; gap: 8px; }
.arch-io-icon { width: 13px; height: 13px; flex-shrink: 0; }
.arch-io-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg3); font-weight: 600; }
.arch-io-text { font-size: 13px; line-height: 1.4; color: var(--fg1); }

/* --------------------------------------------------------------------------
   D365 WMS PAGE — warehouse process chevrons
   -------------------------------------------------------------------------- */
.funnel { display: flex; align-items: stretch; min-width: 720px; padding: 0 20px; }
.funnel-step { flex: 1; clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%, 8% 50%); padding: 20px 24px 20px 32px; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--fg-on-brand); line-height: 1.3; }
.funnel-step + .funnel-step { margin-left: -20px; }

/* --------------------------------------------------------------------------
   D365 WMS PAGE — licensing cost simulator
   -------------------------------------------------------------------------- */
.sim-toggle-btn { border: none; cursor: pointer; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-pill); font-family: var(--font-sans); background: transparent; color: var(--fg2); transition: background var(--dur-fast), color var(--dur-fast); }
.sim-toggle-btn.is-active { background: var(--brand); color: var(--fg-on-brand); }
.sim-step-btn { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); font-size: 16px; font-weight: 600; cursor: pointer; color: var(--fg1); }
.sim-step-btn:hover { background: var(--surface-2); }
.sim-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.sim-card-title { font-weight: 600; font-size: 14.5px; color: var(--fg1); }
.sim-card-rate { font-family: var(--font-mono); font-size: 12px; color: var(--fg3); margin-top: 2px; }
.sim-stepper { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.sim-count { font-family: var(--font-mono); font-size: 16px; font-weight: 600; min-width: 28px; text-align: center; }
