/* ============================================================
   16fold.ai — apex shared styles
   Visual register: black + CM-orange accent, Inter + DM Serif Display.
   Note: 16Fold's brand-engine idiom is BLUEPRINT (sf-blue #1F3A5F) per
   CLAUDE.md, used in internal docs / engine surfaces. The PUBLIC apex
   keeps the black + orange register established by the Coming-Soon
   page — premium, serious, distinct from the engine-side blueprint.

   SCOPING DISCIPLINE:
   This file gets injected into existing pages that have their own
   stylesheets (jeeves-product-spec, beta-agreement, etc.). To avoid
   collisions, ONLY two kinds of rules are unscoped:
     1. `.apex-*` prefixed classes (the nav + footer chrome — safe by name)
     2. nothing else
   Every generic-named rule (.hero, .section, .btn, .stats, etc.) is
   wrapped under `body.apex-page` so embedded pages opt out by default.
   Hand-written apex pages set `<body class="apex-page">`.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --black: #0a0a08;
  --charcoal: #141410;
  --slate: #1f1f1c;
  --orange: #F15A29;
  --orange-dim: rgba(241,90,41,0.12);
  --white: #fafaf7;
  --muted: rgba(250,250,247,0.45);
  --muted-strong: rgba(250,250,247,0.65);
  --border: rgba(250,250,247,0.08);
  --border-strong: rgba(250,250,247,0.16);
  --maxw: 1100px;
}

/* ────────────────────────────────────────────────────────────
   APEX NAV (shared across all routes, safe to inject anywhere)
   Uses apex- prefix to avoid colliding with embedded pages.
   ──────────────────────────────────────────────────────────── */
.apex-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,8,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
}
.apex-nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  box-sizing: border-box;
}
.apex-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--white) !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 10px;
}
.apex-brand .num { color: var(--orange) !important; }
.apex-brand .dot-grid {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-image: radial-gradient(var(--orange) 1.2px, transparent 1.3px);
  background-size: 5px 5px;
  background-position: 0 0;
  opacity: 0.9;
}
.apex-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.apex-link {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--muted-strong) !important;
  text-decoration: none !important;
  transition: color 0.15s;
}
.apex-link:hover { color: var(--white) !important; }
.apex-link.active { color: var(--orange) !important; }
.apex-cta {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 9px 16px;
  background: var(--orange) !important;
  color: var(--white) !important;
  border-radius: 7px;
  text-decoration: none !important;
  transition: opacity 0.15s, transform 0.1s;
}
.apex-cta:hover { opacity: 0.92; transform: translateY(-1px); }

/* ────────────────────────────────────────────────────────────
   APEX FOOTER (shared across all routes, apex- prefixed)
   ──────────────────────────────────────────────────────────── */
.apex-footer {
  border-top: 1px solid var(--border);
  background: var(--charcoal);
  padding: 32px 24px;
  margin-top: 80px;
  font-family: 'Inter', sans-serif;
}
.apex-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}
.apex-footer-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--muted-strong) !important;
}
.apex-footer-brand .num { color: var(--orange) !important; }
.apex-footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.apex-footer-link {
  font-size: 12px;
  color: var(--muted) !important;
  text-decoration: none !important;
  letter-spacing: 0.3px;
}
.apex-footer-link:hover { color: var(--white) !important; }
.apex-footer-powered {
  font-size: 11px;
  color: rgba(250,250,247,0.25) !important;
  letter-spacing: 0.5px;
}
.apex-footer-powered a { color: rgba(250,250,247,0.4) !important; text-decoration: none !important; }
.apex-footer-powered a:hover { color: var(--muted-strong) !important; }

@media (max-width: 720px) {
  .apex-links { gap: 16px; }
  .apex-link { font-size: 12px; }
  .apex-cta { padding: 8px 12px; font-size: 12px; }
  .apex-footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 480px) {
  .apex-link[data-mobile-hide] { display: none; }
}

/* ============================================================
   EVERYTHING BELOW IS SCOPED to body.apex-page
   Hand-written apex pages (/, /install, /inside) add this class
   so the styles apply. Embedded existing pages (/jeeves, /beta)
   DON'T add the class, so they keep their own styles intact.
   ============================================================ */

body.apex-page,
body.apex-page * ,
body.apex-page *::before,
body.apex-page *::after {
  box-sizing: border-box;
}

body.apex-page {
  margin: 0;
  padding: 0;
  background: var(--black);
  color: var(--white);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.apex-page h1,
body.apex-page h2,
body.apex-page h3,
body.apex-page h4,
body.apex-page p,
body.apex-page ul,
body.apex-page ol {
  margin: 0;
  padding: 0;
}

body.apex-page a { color: inherit; }

/* ── PAGE LAYOUT ── */
body.apex-page .page {
  min-height: calc(100vh - 60px);
  position: relative;
}
body.apex-page .section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px 24px;
}
body.apex-page .section--tight { padding: 56px 24px; }
body.apex-page .section--narrow { max-width: 760px; }

/* ── TYPOGRAPHY ── */
body.apex-page .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 24px;
}
body.apex-page .headline-xl {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  font-weight: normal;
}
body.apex-page .headline-xl em {
  font-style: italic;
  color: var(--orange);
}
body.apex-page .headline-l {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  font-weight: normal;
}
body.apex-page .headline-m {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(24px, 3.5vw, 36px);
  line-height: 1.1;
  margin-bottom: 12px;
  font-weight: normal;
}
body.apex-page .subhead {
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: clamp(18px, 2.5vw, 26px);
  color: var(--muted-strong);
  margin-bottom: 32px;
  line-height: 1.3;
}
body.apex-page .lede {
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted-strong);
  max-width: 640px;
  margin-bottom: 32px;
}
body.apex-page .body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted-strong);
  max-width: 640px;
}
body.apex-page .divider {
  width: 40px;
  height: 2px;
  background: var(--orange);
  margin: 32px 0;
  opacity: 0.6;
  border: 0;
}

/* ── BUTTONS ── */
body.apex-page .btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, background 0.15s;
}
body.apex-page .btn-primary {
  background: var(--orange);
  color: var(--white);
}
body.apex-page .btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
body.apex-page .btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--border-strong);
}
body.apex-page .btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: var(--orange); }
body.apex-page .btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ── CTA CARDS GRID (homepage) ── */
body.apex-page .cta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 760px;
  margin: 0 auto 64px;
}
body.apex-page .cta-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
}
body.apex-page .cta-card:hover {
  border-color: var(--orange);
  background: rgba(241,90,41,0.04);
  transform: translateY(-2px);
}
body.apex-page .cta-card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}
body.apex-page .cta-card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.1;
}
body.apex-page .cta-card-body {
  font-size: 14px;
  color: var(--muted-strong);
  line-height: 1.55;
  margin-bottom: 12px;
}
body.apex-page .cta-card-arrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  letter-spacing: 0.3px;
}

/* ── STATS ROW ── */
body.apex-page .stats {
  display: flex;
  gap: 0;
  margin: 48px auto;
  max-width: 540px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(10px);
}
body.apex-page .stat {
  flex: 1;
  padding: 22px 24px;
  border-right: 1px solid var(--border);
  text-align: center;
}
body.apex-page .stat:last-child { border-right: none; }
body.apex-page .stat-number {
  font-family: 'DM Serif Display', serif;
  font-size: 32px;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 6px;
}
body.apex-page .stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── HERO (homepage only — full-viewport hero) ── */
body.apex-page .hero {
  position: relative;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  overflow: hidden;
}
body.apex-page .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body.apex-page .hero-bg-glow {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(241,90,41,0.14) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}
body.apex-page .hero-bg-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
  transform: translate(-50%, -50%);
  left: 50%; top: 50%;
  animation: apexPulse 8s ease-in-out infinite;
}
body.apex-page .hero-bg-ring:nth-child(2) { width: 320px;  height: 320px;  animation-delay: 0s; }
body.apex-page .hero-bg-ring:nth-child(3) { width: 620px;  height: 620px;  animation-delay: 1.5s; }
body.apex-page .hero-bg-ring:nth-child(4) { width: 940px;  height: 940px;  animation-delay: 3s; }
body.apex-page .hero-bg-ring:nth-child(5) { width: 1300px; height: 1300px; animation-delay: 4.5s; }

@keyframes apexPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.65; }
}

body.apex-page .hero-inner { position: relative; z-index: 1; max-width: 760px; }
body.apex-page .hero-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 28px;
}
body.apex-page .hero-origin {
  max-width: 520px;
  margin: 0 auto 36px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted-strong);
}
body.apex-page .hero-origin strong { color: var(--white); font-weight: 600; }
body.apex-page .hero-cta-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* ── PROSE (long-form content pages) ── */
body.apex-page .prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 24px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted-strong);
}
body.apex-page .prose h1,
body.apex-page .prose h2,
body.apex-page .prose h3 {
  font-family: 'DM Serif Display', serif;
  color: var(--white);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: normal;
}
body.apex-page .prose h1 { font-size: clamp(40px, 6vw, 64px); margin-bottom: 24px; }
body.apex-page .prose h2 { font-size: clamp(28px, 4vw, 38px); margin-top: 56px; margin-bottom: 16px; }
body.apex-page .prose h3 { font-size: clamp(20px, 3vw, 26px); margin-top: 32px; margin-bottom: 12px; }
body.apex-page .prose p { margin-bottom: 18px; }
body.apex-page .prose ul,
body.apex-page .prose ol { margin: 16px 0 24px 24px; }
body.apex-page .prose li { margin-bottom: 10px; }
body.apex-page .prose strong { color: var(--white); font-weight: 600; }
body.apex-page .prose em { font-style: italic; color: var(--muted-strong); }
body.apex-page .prose a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
body.apex-page .prose blockquote {
  border-left: 3px solid var(--orange);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
  color: var(--white);
  font-style: italic;
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
}

/* ── MOBILE ── */
@media (max-width: 720px) {
  body.apex-page .cta-grid { grid-template-columns: 1fr; }
  body.apex-page .stats { flex-direction: column; max-width: 360px; }
  body.apex-page .stat { border-right: none; border-bottom: 1px solid var(--border); }
  body.apex-page .stat:last-child { border-bottom: none; }
  body.apex-page .hero-cta-row { flex-direction: column; align-items: stretch; }
}

/* ── ANIMATIONS ── */
body.apex-page .fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: apexFadeUp 0.7s ease forwards;
}
body.apex-page .fade-up:nth-child(1) { animation-delay: 0.05s; }
body.apex-page .fade-up:nth-child(2) { animation-delay: 0.15s; }
body.apex-page .fade-up:nth-child(3) { animation-delay: 0.25s; }
body.apex-page .fade-up:nth-child(4) { animation-delay: 0.35s; }
body.apex-page .fade-up:nth-child(5) { animation-delay: 0.45s; }
body.apex-page .fade-up:nth-child(6) { animation-delay: 0.55s; }
body.apex-page .fade-up:nth-child(7) { animation-delay: 0.65s; }
body.apex-page .fade-up:nth-child(8) { animation-delay: 0.75s; }

@keyframes apexFadeUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── UTILITIES ── */
body.apex-page .center-text { text-align: center; }
body.apex-page .muted { color: var(--muted); }
body.apex-page .note {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 28px;
}
