/* ═══════════════════════════════════════════════════════════════════════════
   BA2B DESIGN SYSTEM  |  main.css
   Applies to every page. Import before any page-specific styles.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fonts load from the single Google Fonts <link> in each page head, not from here. */

/* ── TOKEN SYSTEM ──────────────────────────────────────────────────────────── */
:root {
  /* backgrounds */
  --bg:        #0B0710;
  --bg-2:      #120B1B;
  --bg-3:      #160E22;
  --bg-4:      #1C1030;

  /* text */
  --ink:       #ECE7F2;
  --soft:      #A99FBC;
  --faint:     #8A80A0;
  --whisper:   #3D2F52;

  /* lines */
  --line:      #241A33;
  --line-2:    #2E2240;

  /* brand accents */
  --cyan:      #36C5E0;
  --violet:    #8B5CF6;
  --magenta:   #C13FD6;

  /* gradient */
  --grad: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --grad-r: linear-gradient(280deg, var(--cyan), var(--violet) 55%, var(--magenta));

  /* phase colors */
  --egg:         #1263B5;
  --egg-lt:      #2A89D4;
  --caterpillar: #4FB6D1;
  --caterpillar-lt: #72CBE3;
  --chrysalis:   #7E78D8;
  --chrysalis-lt: #9E99E8;
  --emergence:   #C13FD6;
  --emergence-lt: #D464E8;
  --flight:      #7A1C9C;
  --flight-lt:   #A035C8;

  /* typography */
  --serif:  'Cormorant Garamond', Georgia, serif;
  --script: 'Dancing Script', cursive;
  --sans:   'Montserrat', system-ui, sans-serif;

  /* spacing */
  --sec-v:  130px;
  --wrap-x: 48px;
  --radius: 4px;

  /* transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── RESET ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Ensure numerals in brand context render as lining figures */
h1, h2, h3, h4, .label, .eyebrow, .btn { font-variant-numeric: lining-nums; }

/* ── LAYOUT ─────────────────────────────────────────────────────────────────── */
.wrap    { max-width: 1180px; margin: 0 auto; padding: 0 var(--wrap-x); }
.wrap-sm { max-width: 840px;  margin: 0 auto; padding: 0 var(--wrap-x); }
.wrap-xs { max-width: 680px;  margin: 0 auto; padding: 0 var(--wrap-x); }

.sec { padding: var(--sec-v) 0; position: relative; }
.sec--border-top  { border-top: 1px solid var(--line); }
.sec--border-both { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec--dark   { background: var(--bg-2); }
.sec--darker { background: var(--bg-3); }

/* ── TYPOGRAPHY ─────────────────────────────────────────────────────────────── */
h1 {
  font-family: var(--serif);
  font-size: clamp(3rem, 6.3vw, 5.3rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.01em;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
h3 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
}
h4 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.3;
}

.script-accent {
  font-family: var(--script);
  font-size: 1.3em;
  font-weight: 600;
  color: var(--violet);
}

.label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
}

.eyebrow {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.eyebrow::before { content: ""; width: 38px; height: 1px; background: var(--grad); }
.eyebrow.center  { justify-content: center; }
.eyebrow.center::after { content: ""; width: 38px; height: 1px; background: var(--grad); }

/* gradient text utility */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.em { font-style: italic; }
.em.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lede {
  margin-top: 22px;
  color: var(--soft);
  font-size: 1.28rem;
  max-width: 60ch;
  line-height: 1.7;
}
.center .lede { margin-left: auto; margin-right: auto; }
.lede.wide { max-width: 72ch; }
.lede.narrow { max-width: 46ch; }

.sec-head { max-width: 760px; }
.sec-head.center { margin: 0 auto; text-align: center; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────────── */
.btn {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 16px 32px;
  border-radius: var(--radius);
  transition: all 0.25s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}
.btn:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: #fff; transform: translateY(-1px); }

.btn-grad {
  background: var(--grad);
  color: #fff;
}
.btn-grad:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-outline {
  color: var(--ink);
  border: 1px solid var(--line-2);
  background: transparent;
}
.btn-outline:hover { border-color: var(--soft); }

.btn-ghost {
  color: var(--soft);
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 16px 4px;
  background: none;
}
.btn-ghost:hover { color: var(--ink); border-bottom-color: var(--violet); }

.btn-phase {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
}

/* checkout buttons whose config URL is still a placeholder (set by navigation.js) */
.btn[data-checkout-pending] {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn[data-checkout-pending]::after {
  content: " (Coming Soon)";
  font-size: 0.6em;
  opacity: 0.7;
}

/* ── NAV ─────────────────────────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--wrap-x);
  transition: background 0.3s, border-color 0.3s, padding 0.3s;
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  background: rgba(11, 7, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
  padding-top: 14px;
  padding-bottom: 14px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.nav-brand strong { font-style: normal; font-weight: 600; }
.nav-logo-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.nav-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--soft);
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }

.nav-cta {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: 40px;
  padding: 11px 24px;
  transition: border-color 0.25s, background 0.25s;
  white-space: nowrap;
}
.nav-cta:hover { border-color: var(--cyan); color: var(--cyan); }

.hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  /* 44px tap target; negative margins keep the nav height and bar position unchanged */
  min-width: 44px;
  min-height: 44px;
  margin: -4px -6px -4px 0;
  padding: 4px;
  cursor: pointer;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 4px); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -4px); }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2rem;
  color: var(--ink);
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--magenta); }
.mobile-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none; border: none;
  color: var(--soft);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

/* ── FOOTER ─────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-3);
  border-top: 1px solid var(--line);
  padding: 72px 0 48px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}
.footer-brand-col .tagline {
  margin-top: 16px;
  color: var(--faint);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 30ch;
}
.footer-col h4,
.footer-heading {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--faint);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  color: var(--soft);
  font-size: 1rem;
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--ink); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom p, .footer-bottom a {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.footer-bottom a:hover { color: var(--soft); }
.footer-bottom .sep { color: var(--whisper); margin: 0 6px; }

/* ── ANIMATIONS & SCROLL REVEALS ─────────────────────────────────────────── */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.js .reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── AMBIENT BACKGROUND ─────────────────────────────────────────────────────── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0;
  animation: orbFloat 8s ease-in-out infinite;
}
.orb.visible { opacity: 1; }
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.35; }
  50%       { transform: translateY(-20px) scale(1.08); opacity: 0.5; }
}

/* ── PROGRESS LINE ─────────────────────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--grad);
  z-index: 100;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── CARDS ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 36px;
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}

/* ── PHASE BADGE ─────────────────────────────────────────────────────────────── */
.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid currentColor;
}

/* ── DIVIDER ─────────────────────────────────────────────────────────────────── */
.divider {
  width: 48px;
  height: 1px;
  background: var(--grad);
  margin: 32px 0;
}
.divider.center { margin-left: auto; margin-right: auto; }

/* ── PILL ─────────────────────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 14px;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── FORMS ─────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 8px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1rem;
  padding: 14px 16px;
  transition: border-color 0.2s;
  outline: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--violet);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #e05;
}
.form-group .error-msg,
.form-consent .error-msg {
  color: #e05;
  font-size: 0.85rem;
  margin-top: 6px;
  font-family: var(--sans);
  display: none;
}
.form-group.has-error .error-msg,
.form-consent.has-error .error-msg { display: block; }
.form-group textarea { resize: vertical; min-height: 140px; }

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--faint);
  line-height: 1.6;
}
.form-consent input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
/* error message wraps onto its own row under the checkbox and label */
.form-consent { flex-wrap: wrap; }
.form-consent label { flex: 1; min-width: 0; }
.form-consent .error-msg { flex-basis: 100%; margin-top: 0; }

.form-success {
  display: none;
  padding: 32px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}
.form-success.active { display: block; }
.form-success h3 { margin-bottom: 12px; }
.form-success p { color: var(--soft); }

.form-error-global {
  display: none;
  padding: 14px 18px;
  background: rgba(220, 0, 80, 0.1);
  border: 1px solid rgba(220, 0, 80, 0.3);
  border-radius: var(--radius);
  color: #f07;
  font-family: var(--sans);
  font-size: 0.82rem;
  margin-top: 12px;
}
.form-error-global.active { display: block; }

/* Honeypot */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── ACCORDIONS ─────────────────────────────────────────────────────────────── */
.accordion-item {
  border-bottom: 1px solid var(--line);
}
.accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  gap: 16px;
}
.accordion-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.accordion-icon {
  width: 22px; height: 22px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s, border-color 0.2s;
  font-size: 0.85rem;
  color: var(--faint);
}
.accordion-btn[aria-expanded="true"] .accordion-icon { transform: rotate(45deg); border-color: var(--violet); color: var(--violet); }
.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.accordion-btn[aria-expanded="true"] ~ .accordion-body { grid-template-rows: 1fr; }
.accordion-body-inner {
  overflow: hidden;
}
.accordion-body-inner p {
  padding-bottom: 22px;
  color: var(--soft);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 72ch;
}

/* ── MODALS ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 7, 16, 0.88);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none; border: none;
  color: var(--soft);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}
.modal-close:hover { color: var(--ink); }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sec-v: 90px; --wrap-x: 32px; }
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 640px) {
  :root { --sec-v: 72px; --wrap-x: 24px; }
  h1 { font-size: clamp(2.4rem, 10vw, 3.4rem); }
  h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ── FOCUS STYLES ─────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

/* ── SKIP LINK AND SCREEN READER TEXT ─────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
main:focus { outline: none; }

.footer-copyright {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 0.7rem;
  color: var(--faint);
}
.footer-bottom a { text-decoration: underline; }

/* ── CHECKOUT HANDOFF DIALOG (built by navigation.js) ─────────────────────── */
.handoff-dialog {
  margin: auto;
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--ink);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}
.handoff-dialog::backdrop { background: rgba(6, 3, 10, 0.78); }
.handoff-inner { padding: 36px 32px 32px; text-align: center; }
.handoff-eyebrow {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--soft);
  margin-bottom: 14px;
}
.handoff-dialog h2 { font-size: 1.8rem; line-height: 1.15; margin-bottom: 12px; }
.handoff-dialog p { color: var(--soft); font-size: 1.05rem; }
.handoff-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }

/* ── REDUCED MOTION: one guard for everything ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
