/* ============================================================
   MAINSPRING — page-specific styles
   ============================================================ */

/* Logo (Mainspring uses square ring mark + mainspring wordmark) */
.logo__mark { width: 22px; height: 22px; flex: 0 0 auto; display: block; }
.logo__text { height: 18px; width: auto; flex: 0 0 auto; display: block; }

/* Hero — wider 1:1 grid, slightly tighter sub */
@media (min-width: 961px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.hero__sub { max-width: 54ch; }

/* Hero title — 75% of the shared display size on the Mainspring page */
.hero__title { font-size: clamp(2.0625rem, 4.125vw, 3.375rem); }

/* Hero brand lockup — Mainspring mark + colour wordmark sitting above the title */
.hero__brand {
  display: flex; align-items: flex-end; gap: 24px;
  margin-bottom: var(--sp-xl);
}
.hero__brand-mark { width: 64px; height: 64px; display: block; flex: 0 0 auto; }
.hero__brand-name { height: 57px; width: auto; display: block; }
@media (max-width: 760px) {
  .hero__brand { gap: 20px; margin-bottom: var(--sp-lg); }
  .hero__brand-mark { width: 48px; height: 48px; }
  .hero__brand-name { height: 42px; }
}

/* Section overrides — rich eyebrow comes from base.css */
.section__head { max-width: 680px; }

/* Development-stage chip with live dot */
.hero__stage {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--sp-md);
  padding: 6px 12px;
  border: 1px solid var(--hairline);
  border-radius: 2px;
  font-family: var(--font-mono); font-size: var(--fs-caption);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--slate);
  background: rgba(247, 245, 240, 0.7);
}
.hero__stage::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  animation: stage-pulse 2.4s var(--ease) infinite;
}
@keyframes stage-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .hero__stage::before { animation: none; } }

/* ============================================================
   SAMPLE CARD — the hero artifact
   ============================================================ */
.sample {
  background: var(--paper);
  border: 1px solid var(--steel-blue);
  border-radius: 4px;
  padding: var(--sp-lg);
  display: flex; flex-direction: column; gap: var(--sp-md);
  box-shadow: 0 1px 0 var(--steel-blue), 0 32px 56px -28px rgba(76, 98, 110, 0.35);
  transform: translateY(-3px);
  transition: border-color var(--dur-panel) var(--ease),
              transform var(--dur-panel) var(--ease),
              box-shadow var(--dur-panel) var(--ease);
}
.sample:hover {
  border-color: var(--mist);
  transform: translateY(0);
  box-shadow: 0 1px 0 var(--mist), 0 24px 48px -32px rgba(14, 14, 16, 0.18);
}
.sample__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--sp-md);
  border-bottom: 1px solid var(--mist);
}
.sample__chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--fs-caption);
  color: var(--slate); letter-spacing: 0.08em; text-transform: uppercase;
}
.sample__dots { display: flex; gap: 4px; }
.sample__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mist); }
.sample__body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--sp-md);
}
@media (max-width: 540px) {
  .sample__body { grid-template-columns: 1fr; }
}
.sample__prompt {
  background: var(--mist);
  padding: var(--sp-md);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--graphite);
}
.sample__prompt-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--slate);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-sm);
}
.sample__params { display: flex; flex-direction: column; gap: 2px; }
.sample__param {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--mist);
  font-size: 13px;
}
.sample__param:last-child { border-bottom: 0; }
.sample__param-name { color: var(--slate); }
.sample__param-value {
  font-family: var(--font-mono);
  color: var(--ink);
}
.sample__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--sp-md);
  border-top: 1px solid var(--mist);
}
.sample__time {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--fs-caption);
  color: var(--slate); letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============================================================
   HOW IT WORKS — three steps
   ============================================================ */
/* Ghost-numeral cards — matches the Approach section on the Automata page */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-xl);
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--paper);
  border: 1px solid rgba(156, 153, 144, 0.35);
  border-radius: 4px;
  padding: var(--sp-xl);
  padding-top: var(--sp-2xl);
  display: flex; flex-direction: column; gap: var(--sp-md);
  min-height: 280px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(156, 153, 144, 0.25);
  transition: transform var(--dur-in) var(--ease), box-shadow var(--dur-in) var(--ease);
}
.step:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -32px rgba(14, 14, 16, 0.25);
}
.step__ghost {
  position: absolute; top: -22px; right: 6px;
  font-family: var(--font-mono);
  font-size: 7.5rem; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(76, 98, 110, 0.22);
  pointer-events: none; user-select: none;
  transition: -webkit-text-stroke-color var(--dur-in) var(--ease);
}
.step:hover .step__ghost { -webkit-text-stroke-color: rgba(76, 98, 110, 0.45); }
.step__num {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--steel-blue);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.step__num::before { content: ""; width: 20px; height: 1px; background: var(--steel-blue); }
.step__icon {
  width: 28px; height: 28px;
  color: var(--steel-blue);
}
.step__title { font-size: var(--fs-h3); color: var(--ink); font-weight: 500; letter-spacing: -0.01em; }
.step__body { color: var(--slate); font-size: var(--fs-body); line-height: 1.6; }

/* ============================================================
   FEATURE GRID
   ============================================================ */
/* Drawing-sheet hairline grid — matches Services on the Automata page */
.features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.feature {
  position: relative;
  display: flex; flex-direction: column; gap: var(--sp-sm);
  padding: var(--sp-xl) var(--sp-lg);
  border-right: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  transition: background-color var(--dur-in) var(--ease);
}
.feature::before {
  content: ""; position: absolute; top: -1px; left: 0;
  width: 100%; height: 2px; background: var(--steel-blue);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-panel) var(--ease);
}
.feature:hover { background: rgba(229, 226, 217, 0.55); }
.feature:hover::before { transform: scaleX(1); }
.feature__icon-box {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-md);
  color: var(--steel-blue);
  transition: background-color var(--dur-in) var(--ease),
              border-color var(--dur-in) var(--ease),
              color var(--dur-in) var(--ease);
}
.feature:hover .feature__icon-box {
  background: var(--steel-blue);
  border-color: var(--steel-blue);
  color: var(--paper);
}
.feature__icon { width: 22px; height: 22px; }
.feature__title {
  font-size: var(--fs-body-l);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.feature__body { font-size: var(--fs-body); color: var(--slate); line-height: 1.6; }

/* ============================================================
   ROADMAP — hairline grid + status chips
   ============================================================ */
.roadmap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--hairline);
  border-left: 1px solid var(--hairline);
}
@media (max-width: 960px) { .roadmap { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .roadmap { grid-template-columns: 1fr; } }
.roadmap .feature { background: var(--paper); }
.roadmap .feature:hover { background: rgba(247, 245, 240, 0.6); }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  padding: 4px 10px;
  margin-bottom: var(--sp-sm);
  border-radius: 2px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.chip--next { color: var(--steel-blue); border: 1px solid var(--steel-blue); }
.chip--next::before { content: ""; width: 5px; height: 5px; background: var(--steel-blue); transform: rotate(45deg); }
.chip--later { color: var(--slate); border: 1px solid var(--hairline); }
.chip--later::before { content: ""; width: 5px; height: 5px; border: 1px solid var(--slate); transform: rotate(45deg); }

/* ============================================================
   PRODUCT PREVIEW
   ============================================================ */
.preview {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line), 0 40px 72px -40px rgba(14, 14, 16, 0.3);
}
.preview::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--steel-blue), var(--glass-blue), transparent 70%);
  z-index: 1;
}
.preview__bar {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: 10px var(--sp-md);
  background: var(--ink);
}
.preview__bar-dots { display: flex; gap: 6px; }
.preview__bar-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--slate); }
.preview__bar-url {
  font-family: var(--font-mono); font-size: var(--fs-caption);
  color: var(--mist); letter-spacing: 0.04em;
  padding: 4px 10px; background: var(--graphite); border-radius: 2px;
}

/* ============================================================
   FOOTER — page-specific extras
   ============================================================ */
.foot__brand p { max-width: 36ch; }
.foot__parent {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--line);
  font-size: var(--fs-body);
}

/* ============================================================
   WAITLIST CTA — hero call-to-action linking to external Clerk waitlist
   ============================================================ */
.waitlist {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-sm);
  margin-top: var(--sp-xl);
  max-width: 56ch;
  scroll-margin-top: 96px;
}

.waitlist__fineprint {
  font-size: var(--fs-caption);
  color: var(--slate);
  margin-top: var(--sp-xs);
}

/* ============================================================
   SAMPLE-FAMILY CAROUSEL — wraps the shared .viewer-3d card.
   Two iframes cross-fade inside the viewport; prev/next arrows
   overlay the canvas; dot indicators sit in the foot.
   ============================================================ */
/* Hero-artifact chrome: stronger frame + steel chip label */
.viewer-3d--carousel {
  border-color: var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 1px 0 var(--line),
    0 32px 56px -28px rgba(74, 74, 80, 0.25);
}
.viewer-3d--carousel .viewer-3d__chip { color: var(--steel-blue); }

.carousel__viewport {
  position: relative;
  overflow: hidden;
}

/* Both frames fill the viewport and stack; the inactive one stays mounted and
   rendering (opacity 0) so the next family can build hidden, then fade in. */
.carousel__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-panel) var(--ease);
}
.carousel__frame.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Prev / next arrows */
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(247, 245, 240, 0.88); /* --paper @ 88% */
  border: 1px solid var(--mist);
  border-radius: 4px;
  color: var(--slate);
  cursor: pointer;
  transition: color var(--dur-in) var(--ease),
              border-color var(--dur-in) var(--ease),
              background var(--dur-in) var(--ease);
}
.carousel__arrow:hover {
  color: var(--steel-blue);
  border-color: var(--steel-blue);
  background: var(--paper);
}
.carousel__arrow:focus-visible {
  outline: 2px solid var(--steel-blue);
  outline-offset: 2px;
}
.carousel__arrow--prev { left: var(--sp-md); }
.carousel__arrow--next { right: var(--sp-md); }
.carousel__arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Dot indicators */
.carousel__dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: background var(--dur-in) var(--ease),
              border-color var(--dur-in) var(--ease),
              transform var(--dur-in) var(--ease);
}
.carousel__dot:hover { border-color: var(--steel-blue); }
.carousel__dot.is-active {
  background: var(--steel-blue);
  border-color: var(--steel-blue);
  transform: scale(1.15);
}
.carousel__dot:focus-visible {
  outline: 2px solid var(--steel-blue);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .carousel__arrow { width: 30px; height: 30px; }
  .carousel__arrow svg { width: 18px; height: 18px; }
  .viewer-3d--carousel .viewer-3d__foot {
    flex-wrap: wrap;
    row-gap: var(--sp-sm);
  }
}
