/* =============================================================
   Ecomma rebuild — shared styles
   Used by index.html, sell.html, buy.html, operate.html, equire.html
   Page-specific styles stay inline in each file.
   ============================================================= */

/* === Tokens === */
:root {
  /* Primitives */
  --c-primary:    #0F172A;
  --c-brand:      #073877;
  --c-brand-deep: #0A4A9A;
  --c-accent:     #57CAFB;
  --c-accent-soft: #D6F0FB;
  --c-ink:        #111827;
  --c-bg:         #FFFFFF;
  --c-bg-soft:    #F6F9FC;
  --c-bg-cyan-tint: #ECF8FE;
  --c-text:       #1F2937;
  --c-text-muted: #4B5563;
  --c-text-soft:  #6B7280;
  --c-rule:       #E5E7EB;
  --c-rule-sub:   #F3F4F6;
  --c-critical:   #B91C1C;

  /* Semantic */
  --bg-page:        var(--c-bg);
  --bg-soft:        var(--c-bg-soft);
  --bg-cyan:        var(--c-bg-cyan-tint);
  --bg-dark:        var(--c-primary);
  --text-default:   var(--c-text);
  --text-headline:  var(--c-ink);
  --text-on-dark:   #FFFFFF;
  --accent:         var(--c-brand);
  --accent-hover:   var(--c-brand-deep);
  --accent-cyan:    var(--c-accent);
  --rule:           var(--c-rule);

  /* Component */
  --btn-primary-bg: var(--accent);
  --btn-primary-fg: #FFFFFF;
  --btn-secondary-bg: transparent;
  --btn-secondary-fg: var(--accent);
  --btn-secondary-border: var(--accent);
  --link: var(--accent);
  --link-on-dark: var(--c-accent);
  --kpi-number: var(--accent);
  --kpi-stroke: var(--accent-cyan);

  /* Layout */
  --maxw: 1440px;
  --gutter: 32px;
  --section-y: 96px;
}

/* === Reset / base === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-padding-top: 110px; /* offsets the sticky site-header so anchored sections aren't hidden under it */
}
:target { scroll-margin-top: 110px; }
/* note: scroll-behavior: smooth was removed — combined with scroll-padding-top + sticky header it silently blocked anchor jumps in Chrome. Smooth scroll is now handled per-page in JS where needed. */
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-default);
  background: var(--bg-page);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Cambria, serif;
  color: var(--text-headline);
  margin: 0 0 16px;
  line-height: 1.15;
  font-weight: 600;
}
h1 { font-size: 64px; }
h2 { font-size: 36px; }
h3 { font-size: 22px; font-family: 'Inter', system-ui, sans-serif; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 16px; }
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin: 0 0 14px;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
section { padding: var(--section-y) 0; }
.section-soft { background: var(--bg-soft); }
.section-cyan { background: var(--bg-cyan); }
.section-dark { background: var(--bg-dark); color: var(--text-on-dark); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--text-on-dark); }
.section-dark a { color: var(--link-on-dark); }
hr.cyan-rule {
  border: 0;
  border-top: 2px solid var(--accent-cyan);
  width: 56px;
  margin: 0 0 24px;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 16px 26px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg);
  border-color: var(--btn-secondary-border);
}
.btn-secondary:hover { background: var(--bg-cyan); border-color: var(--accent-cyan); text-decoration: none; }
.btn-ghost { color: var(--text-default); padding-left: 0; padding-right: 0; font-weight: 600; }
.btn-ghost::after { content: " →"; color: var(--accent-cyan); }

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(140%) blur(8px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 32px;
}
.logo-img {
  height: 36px;
  width: auto;
  display: block;
}
.nav-primary { display: flex; gap: 48px; align-items: center; }
.nav-primary a {
  color: var(--text-default);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: -0.005em;
}
.nav-primary a:hover { color: var(--accent-cyan); text-decoration: none; }
.nav-primary a.is-active {
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  position: relative;
}
.nav-primary a.is-active::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -28px;
  height: 2px;
  background: var(--accent-cyan);
}

/* Buy dropdown — hover-opened mini-menu */
.nav-has-children { position: relative; }
.nav-has-children > a { display: inline-flex; align-items: center; gap: 6px; }
.nav-has-children > a::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  opacity: 0.55;
  transition: transform 160ms ease, opacity 160ms ease;
}
.nav-has-children:hover > a::after { opacity: 1; transform: rotate(45deg) translate(0, 0); }
.nav-children {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 360px;
  background: #FFFFFF;
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 24px 48px -28px rgba(7, 56, 119, 0.32);
  padding: 12px;
  display: grid;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms;
  z-index: 100;
}
.nav-has-children:hover > .nav-children,
.nav-has-children:focus-within > .nav-children {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* Invisible bridge so the menu doesn't disappear when traversing the gap */
.nav-children::before {
  content: '';
  position: absolute;
  top: -18px; left: 0; right: 0;
  height: 18px;
}
.nav-children > a {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 140ms ease;
}
.nav-children > a:hover { background: var(--bg-cyan); text-decoration: none; }
.nav-children .nav-child-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-headline);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.nav-children .nav-child-desc {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
/* Small AI sonar glyph next to the Ecomma.ai nav link */
.nav-ai-link { display: inline-flex; align-items: center; gap: 8px; }
.nav-ai-glyph {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-block;
  flex-shrink: 0;
}
.nav-ai-glyph::before,
.nav-ai-glyph::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.6px solid var(--accent-cyan);
  opacity: 0;
  transform: scale(0.35);
  animation: navAiSonar 2.4s ease-out infinite;
}
.nav-ai-glyph::after {
  animation-delay: 1.2s;
}
.nav-ai-glyph .core {
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(87, 202, 251, 0.85);
  animation: navAiCore 2.4s ease-in-out infinite;
}
@keyframes navAiSonar {
  0%   { opacity: 0;    transform: scale(0.35); }
  35%  { opacity: 0.95; }
  100% { opacity: 0;    transform: scale(1.15); }
}
@keyframes navAiCore {
  0%, 100% { transform: scale(1);   box-shadow: 0 0 8px rgba(87, 202, 251, 0.7); }
  50%      { transform: scale(1.3); box-shadow: 0 0 14px rgba(87, 202, 251, 1); }
}

.nav-actions { display: flex; gap: 14px; align-items: center; }
.nav-secondary {
  color: var(--accent-cyan);
  font-size: 15px;
  font-weight: 600;
}

/* === In-page sub-nav (sticky sidebar on desktop, top tab strip on mobile) === */
.sub-nav-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 64px;
  align-items: flex-start;
}
.sub-nav {
  position: sticky;
  top: 180px;
  padding: 24px 0;
  border-left: 2px solid var(--rule);
  align-self: start;
}
.sub-nav-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  padding-left: 20px;
  margin-bottom: 16px;
}
.sub-nav ul { list-style: none; padding: 0; margin: 0; }
.sub-nav li { margin-bottom: 4px; }
.sub-nav a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 120ms ease, border-color 120ms ease;
}
.sub-nav a:hover {
  color: var(--accent);
  border-left-color: var(--accent-cyan);
  text-decoration: none;
}
.sub-nav a.is-active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
}

/* === Block label — hidden, kept in markup for internal reference === */
.block-label { display: none !important; }

/* === Hero headline accent — italic + cyan, used as a typographic signature === */
.h-accent {
  font-family: 'Playfair Display', Cambria, serif;
  font-style: italic;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* === Hero network background (variant D — asymmetric, edges-weighted) === */
.hero-net-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero-net-bg circle { fill: var(--accent-cyan); opacity: 0.6; }
.hero-net-bg line { stroke: var(--accent-cyan); opacity: 0.22; stroke-width: 1.2; }
.hero-net-bg circle.lit {
  animation: hero-net-pulse 4s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes hero-net-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.4); opacity: 0.95; }
}
/* Ensure hero content stays above the network */
.hero-sell .hero-inner,
.hero-buy .hero-inner,
.hero-operate .hero-inner,
.hero-ai .hero-inner,
.hero-equire .hero-inner {
  position: relative;
  z-index: 1;
}

/* === Inline script bootstrap for sub-nav smooth scroll + scrollspy ===
   Loaded by every page that includes styles.css. Handles:
   - Click on any in-page anchor → smooth scroll with header offset
   - Active link tracking on .sub-nav as user scrolls
*/

/* === Prototype-page nav (cross-prototype navigation, prototype-only) === */
.proto-pages-bar {
  background: #1F2937;
  color: rgba(255,255,255,0.78);
  padding: 8px 0;
  font-size: 12px;
}
.proto-pages-bar .container {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.proto-pages-bar a {
  color: rgba(255,255,255,0.78);
  font-weight: 500;
}
.proto-pages-bar a:hover { color: var(--accent-cyan); text-decoration: none; }
.proto-pages-bar .proto-here { color: var(--accent-cyan); font-weight: 600; }

/* === CTA band === */
.cta-band {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 96px 0;
  text-align: center;
  position: relative;
}
.cta-band h2 { color: var(--text-on-dark); font-size: 40px; max-width: 720px; margin-left: auto; margin-right: auto; }
.cta-band p { color: rgba(255,255,255,0.8); max-width: 640px; margin: 0 auto 32px; font-size: 17px; }
.cta-band .btn-primary { background: var(--c-accent); color: var(--c-primary); }
.cta-band .btn-primary:hover { background: #FFFFFF; }

/* === Footer === */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.78);
  padding: 80px 0 40px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 56px;
}
.footer-logo-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: #FFFFFF;
  margin-bottom: 16px;
}
.footer-logo-text .footer-logo-e { color: var(--c-accent); }
.footer-logo-text .footer-logo-quote { color: var(--c-accent); font-weight: 700; }
.site-footer h5 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  m