/* ============================================================
   Hero — ConstructionX AI
   Built on the brand tokens in colors_and_type.css.
   ============================================================ */

body {
  margin: 0;
  padding-top: var(--nav-height);
  background: var(--bg-page);
  color: var(--fg-1);
  overflow-x: hidden;
}

.cx-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

/* ============================================================
   Nav (lifted from kit, kept minimal)
   ============================================================ */
.cx-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--nav-tint);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 1000;
  display: flex; align-items: center;
}
.cx-nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: var(--max-width);
  margin: 0 auto; padding: 0 1.5rem;
}
.cx-nav__logo { display: flex; align-items: center; gap: .75rem; cursor: pointer; text-decoration: none; }
.cx-nav__logo img { height: 36px; width: 36px; display: block; }
.cx-nav__logo span { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--cx-slate-100); letter-spacing: -0.005em; }
.cx-nav__links { display: flex; align-items: center; gap: 2rem; }
.cx-nav__links a {
  font-family: var(--font-body);
  font-size: .9rem; font-weight: 500;
  color: var(--fg-2); cursor: pointer; text-decoration: none;
  position: relative; white-space: nowrap;
  transition: color var(--dur-2) var(--ease);
}
.cx-nav__links a:hover, .cx-nav__links a.active { color: var(--fg-1); }
.cx-nav__links a.active::after {
  content: ''; position: absolute; bottom: -28px; left: 0; right: 0;
  height: 2px; background: var(--fg-accent); border-radius: 1px;
}
.cx-nav__links a.cx-btn { color: var(--fg-on-accent); }
.cx-nav__links a.cx-btn:hover { color: var(--fg-on-accent); }

/* ============================================================
   Buttons
   ============================================================ */
.cx-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600;
  border-radius: var(--radius); border: 2px solid transparent;
  cursor: pointer; letter-spacing: .02em;
  transition: all var(--dur-2) var(--ease);
  text-decoration: none;
}
.cx-btn--sm { padding: .55rem 1.2rem; font-size: .85rem; }
.cx-btn--lg { padding: 1rem 2rem; font-size: 1rem; }
.cx-btn--primary { background: var(--cx-green-500); color: var(--fg-on-accent); border-color: var(--cx-green-500); }
.cx-btn--primary:hover { background: var(--cx-green-600); border-color: var(--cx-green-600); transform: translateY(-1px); box-shadow: var(--shadow-btn-glow); }
.cx-btn--outline { background: transparent; color: var(--cx-green-500); border-color: var(--cx-green-500); }
.cx-btn--outline:hover { background: var(--cx-green-500); color: var(--fg-on-accent); transform: translateY(-1px); }

/* ============================================================
   Badge
   ============================================================ */
.cx-badge {
  display: inline-block;
  background: var(--cx-green-100-a15);
  color: var(--fg-accent);
  font-family: var(--font-display);
  font-size: .72rem; font-weight: 600;
  padding: .35rem .85rem;
  border-radius: var(--radius-pill);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ============================================================
   Hero layout
   ============================================================ */
.hero {
  background: var(--bg-page);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 3rem;
  align-items: center;
  min-height: calc(100vh - var(--nav-height) - 9rem);
}

.hero__col--copy { max-width: 640px; }

.hero__badge { margin-bottom: 1.5rem; }

.hero__h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5.2vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--fg-1);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--fg-2);
  margin: 0 0 2.25rem;
  max-width: 560px;
  text-wrap: pretty;
}

.hero__actions {
  display: flex; flex-wrap: wrap; gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero__tagline {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  font-family: var(--font-body);
  font-style: italic;
  font-size: .9rem;
  color: var(--fg-2);
  margin: 0;
}
.hero__tagline-strong { color: var(--fg-accent); font-weight: 500; font-style: italic; }
.hero__tagline-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--cx-slate-600);
}

/* ============================================================
   Motion moment — the blueprint
   ============================================================ */
.hero__col--moment {
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blueprint {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  background: var(--cx-slate-900);
  border: 1px solid var(--border);
  overflow: hidden;
  /* perspective for the 3D rotation of the stage */
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

/* Faint paper grid behind the stage (does not rotate — feels like "table") */
.blueprint__paper {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
  opacity: 0.85;
  pointer-events: none;
}

/* The stage rotates slowly around Y. Camera (perspective container) is static. */
.blueprint__stage {
  position: absolute;
  inset: 8%;
  transform-style: preserve-3d;
  /* Tilt the plan so it reads as a top-down architectural drawing being viewed at a slight angle */
  transform: rotateX(58deg) rotateZ(0deg);
}
.blueprint__svg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  animation: bp-rotate 24s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes bp-rotate {
  from { transform: rotateZ(0deg); }
  to   { transform: rotateZ(360deg); }
}

/* SVG layer styling --------------------------------------- */
.bp-grid line {
  stroke: var(--cx-slate-600);
  stroke-width: 0.5;
  opacity: 0.18;
}
.bp-outer {
  fill: rgba(34, 197, 94, 0.025);
  stroke: var(--cx-slate-400);
  stroke-width: 1.2;
  stroke-linejoin: round;
  opacity: 0.85;
}
.bp-interior line {
  stroke: var(--cx-slate-400);
  stroke-width: 0.8;
  opacity: 0.55;
}
.bp-paths path {
  fill: none;
  stroke: var(--cx-slate-400);
  stroke-width: 0.6;
  stroke-dasharray: 3 3;
  opacity: 0.4;
}
.bp-marks line {
  stroke: var(--cx-slate-400);
  stroke-width: 0.5;
  opacity: 0.3;
}
.bp-nodes circle {
  fill: var(--cx-slate-400);
  opacity: 0.55;
}

/* Hot opportunity nodes — quiet, breathing pulse */
.bp-hotnode__core {
  fill: var(--cx-green-500);
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.6));
}
.bp-hotnode__halo {
  fill: var(--cx-green-500);
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  animation: bp-halo 4s ease-out infinite;
}
.bp-hotnode--1 .bp-hotnode__halo { animation-delay: 0s; }
.bp-hotnode--2 .bp-hotnode__halo { animation-delay: 1.4s; }
.bp-hotnode--3 .bp-hotnode__halo { animation-delay: 2.8s; }

@keyframes bp-halo {
  0%   { opacity: 0.45; transform: scale(0.4); }
  60%  { opacity: 0; transform: scale(1.6); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* Pulses of light travelling the wiring */
.bp-pulse {
  fill: var(--cx-green-500);
  filter: drop-shadow(0 0 5px rgba(34, 197, 94, 0.7));
  animation: bp-pulse-fade 8s ease-in-out infinite;
}
.bp-pulse--1 { animation-delay: 0s; }
.bp-pulse--2 { animation-delay: -2s; }
.bp-pulse--3 { animation-delay: -4s; }
.bp-pulse--4 { animation-delay: -6s; }

@keyframes bp-pulse-fade {
  0%   { opacity: 0.30; }
  50%  { opacity: 0.80; }
  100% { opacity: 0.30; }
}

/* Stamp / corner caption */
.blueprint__stamp {
  position: absolute;
  bottom: 1rem; left: 1rem;
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 0.55rem 0.85rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2;
}
.blueprint__stamp-label {
  font-family: var(--font-display);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg-accent);
}
.blueprint__stamp-meta {
  font-family: var(--font-mono);
  font-size: .65rem;
  color: var(--fg-2);
  letter-spacing: .04em;
}

/* ============================================================
   Trust bar (below the fold)
   ============================================================ */
.trustbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem 1.5rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border-soft);
}

.trustbar__item {
  display: flex; flex-direction: column; gap: .25rem;
  flex: 1;
  min-width: 0;
}
.trustbar__value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}
.trustbar__label {
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--fg-2);
  line-height: 1.4;
}
.trustbar__divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: 3rem;
    min-height: 0;
  }
  .hero__col--moment { order: 2; }
  .blueprint { max-width: 380px; margin: 0 auto; }
  .trustbar { flex-wrap: wrap; gap: 1.5rem 2rem; }
  .trustbar__divider { display: none; }
  .trustbar__item { flex: 1 1 40%; }
  .cx-nav__links a:not(.cx-btn) { display: none; }
}

@media (max-width: 540px) {
  .hero { padding: 3rem 0 3rem; }
  .hero__h1 { font-size: clamp(2.1rem, 9vw, 2.6rem); }
  .hero__subtitle { font-size: 1.05rem; }
  .hero__actions .cx-btn { flex: 1 1 100%; }
  .blueprint { max-width: 320px; }

  /* Freeze blueprint animation on mobile */
  .blueprint__svg { animation: none !important; }
  .bp-pulse { animation: none !important; opacity: 0.65 !important; }
  .bp-hotnode__halo { animation: none !important; opacity: 0.15 !important; transform: scale(1.1); }
}

/* ============================================================
   Reduced motion — static fallback
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .blueprint__svg { animation: none !important; }
  .bp-pulse { animation: none !important; opacity: 0.7 !important; }
  .bp-pulse animateMotion { display: none; }
  .bp-hotnode__halo {
    animation: none !important;
    opacity: 0.18 !important;
    transform: scale(1.2);
  }
  .cx-btn { transition: none !important; }
  .cx-btn:hover { transform: none !important; }
}
