﻿/**
 * ActiveZone — #prototype v3 (slider-dots specimen + KIE)
 * LAW: AURA_PROTOTYPE_DIRECTION.md + AURA_PROTOTYPE_COMPOSITION.md
 * Layout C: left funnel · right .prototype-* tabs (spirit #services, not clone)
 * Visual B: stylized wireframe + sharp KIE photo slots (NO blur)
 * Shell: section on page bg; funnel+specimen+CTA in .prototype-card (= .folder-panel)
 * Dots: sibling under white .prototype-specimen, on gray card (no white plate)
 */

/* Soft-Accent focus / hit targets */
#prototype .btn--accent:hover,
#prototype .btn--accent:active {
  background: #e65000;
}

#prototype .btn--accent:focus-visible,
#prototype .btn--primary:focus-visible,
#prototype .btn--outline:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

#prototype .btn {
  min-height: 48px;
  min-width: 44px;
}

/* ── Zone rhythm: inter ≥ 2× intra ── */
.prototype-zone {
  min-width: 0;
}

.prototype-zone + .prototype-zone {
  margin-block-start: var(--space-7);
}

@media (min-width: 1025px) {
  .prototype-zone + .prototype-zone {
    margin-block-start: var(--space-8);
  }
}

#prototype .section__head {
  margin-block-end: 0;
}

#prototype .section__head h2 {
  font-family: var(--font-display);
  text-wrap: balance;
}

.prototype-lead {
  margin: 0;
  max-width: var(--measure, 65ch);
  font-family: var(--font-body);
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--color-muted);
}

.prototype-timeline {
  font-weight: 600;
  color: var(--color-ink);
}

/* zone-label type scoped under .prototype-funnel (see LEFT funnel type block) */

/* ── ZONE B · Card shell (mirror .folder-panel) ── */
.prototype-card {
  position: relative;
  min-width: 0;
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  /* Kill full-bleed gray band — surface lives only inside this card */
}

@media (min-width: 768px) {
  .prototype-card {
    padding: var(--space-6) var(--space-7);
  }
}

/* ── ZONE B · Split (inside card) ── */
.prototype-split {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  min-width: 0;
}

@media (min-width: 1024px) {
  .prototype-split {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--space-7);
    align-items: start;
  }
}

/* ── LEFT funnel ── */
.prototype-funnel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
  max-width: 65ch;
  /* type hierarchy — HITL zone labels = H3 zone titles (specimen DENY) */
  --proto-funnel-label-size: var(--text-lg);
  --proto-funnel-label-weight: 600;
  --proto-funnel-title-size: var(--text-base);
  --proto-funnel-title-weight: 600; /* steps only */
  --proto-funnel-pain-weight: 400; /* body-list peers; NOT title-weight */
  --proto-funnel-body-weight: 400;
  --proto-funnel-meta-size: var(--text-sm);
  --proto-funnel-note-size: var(--text-xs);
}

.prototype-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.prototype-funnel .prototype-bullets li {
  position: relative;
  padding-inline-start: var(--space-5);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--proto-funnel-body-weight);
  line-height: 1.45;
  color: var(--color-ink);
}

.prototype-bullets li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.prototype-funnel .prototype-zone-label {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--proto-funnel-label-size);
  font-weight: var(--proto-funnel-label-weight);
  line-height: var(--leading-snug);
  letter-spacing: normal;
  color: var(--color-ink);
  text-transform: none;
}

/* Pains stack — density + weight 400 (AURA_PROTOTYPE_PAINS_DENSITY.md)
   H3→kids: one channel like .prototype-steps-block (label mb space-3 only; no parent gap)
   DENY: .prototype-specimen / tabs / dots / KIE */
.prototype-pains {
  display: flex;
  flex-direction: column;
  gap: 0; /* single H3→kids channel via .prototype-zone-label mb --space-3 */
  min-width: 0;
}

.prototype-pain {
  min-width: 0;
  padding: 0; /* kill fake-card pad voids */
  border-radius: 0;
  border: 0 solid transparent;
  background: transparent;
}

.prototype-funnel .prototype-pain__title {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--proto-funnel-title-size);
  font-weight: var(--proto-funnel-pain-weight); /* 400 — not title-weight 600 */
  line-height: 1.45; /* bullets rhythm */
  color: var(--color-ink);
}

.prototype-pains__stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3); /* = bullets; was --space-2 */
  min-width: 0;
}

.prototype-steps-block {
  min-width: 0;
}

.prototype-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.prototype-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  min-width: 0;
}

.prototype-step__pin {
  width: var(--pin-size, 32px);
  height: var(--pin-size, 32px);
  border-radius: 50%;
  background: var(--pin-fill, var(--color-accent));
  color: var(--color-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.prototype-funnel .prototype-step__title {
  margin: 0 0 var(--space-1);
  font-family: var(--font-body);
  font-size: var(--proto-funnel-title-size);
  font-weight: var(--proto-funnel-title-weight);
  color: var(--color-ink);
}

.prototype-funnel .prototype-step__text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--proto-funnel-meta-size);
  font-weight: var(--proto-funnel-body-weight);
  line-height: 1.45;
  color: var(--color-muted);
}

.prototype-funnel .prototype-forwhom {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--proto-funnel-note-size);
  font-weight: var(--proto-funnel-body-weight);
  line-height: 1.45;
  color: var(--color-muted);
  max-width: 65ch;
}

/* ── RIGHT tabs root (specimen window + dots sibling) ── */
.prototype-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin: 0;
  padding: 0;
  min-width: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

@media (min-width: 1024px) {
  .prototype-tabs {
    position: sticky;
    top: calc(var(--header-h, 72px) + var(--space-4));
  }

  .prototype-panels {
    min-height: 440px;
  }
}

/* White browser window only — chrome + title/badge + panels */
.prototype-specimen {
  margin: 0;
  min-width: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.prototype-specimen__chrome {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border-block-end: 1px solid var(--color-border);
  min-height: 44px;
}

.prototype-specimen__dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.prototype-specimen__dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
}

.prototype-specimen__url {
  flex: 1;
  min-width: 0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prototype-specimen__title {
  margin: 0;
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: var(--leading-snug);
  color: var(--color-ink);
  text-align: start;
}

.prototype-specimen__badge {
  margin: 0;
  padding: 0 var(--space-4) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-muted);
}

/* Dots under white window, on gray .prototype-card — no plate/pill */
.prototype-tablist,
.prototype-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
  position: relative;
  z-index: 2;
  margin-block: var(--space-2) 0;
  padding-inline: 0;
  padding-block: 0;
  min-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.prototype-tab,
.prototype-dot {
  box-sizing: border-box;
  flex: 0 0 auto;
  appearance: none;
  position: relative;
  /* a11y hit ≥44; visual via ::before only */
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out);
}

/* Visual indicator — tiny ~7px, not button-sized */
.prototype-tab::before,
.prototype-dot::before {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--color-muted);
  background: transparent;
  transform: translate(-50%, -50%);
  transition:
    width var(--duration-fast) var(--ease-out),
    height var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.prototype-tab:hover:not([aria-selected="true"])::before,
.prototype-dot:hover:not([aria-selected="true"])::before {
  border-color: var(--color-ink);
  transform: translate(-50%, -50%) scale(1.1);
}

.prototype-tab:focus-visible,
.prototype-dot:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.prototype-tab:active,
.prototype-dot:active {
  transform: scale(0.96);
}

/* Active — filled accent, slightly larger (~9px) */
.prototype-tab[aria-selected="true"]::before,
.prototype-dot[aria-selected="true"]::before {
  width: 9px;
  height: 9px;
  border-color: var(--color-accent);
  background: var(--color-accent);
}

/* Legacy folder-tab labels removed from DOM; keep inert for safety */
.prototype-tab__num,
.prototype-tab__label {
  display: none;
}

.prototype-panels {
  position: relative;
  z-index: 1;
  background: var(--color-surface-2);
  border-radius: 0;
  padding: var(--space-4);
  min-height: 280px;
  min-width: 0;
  /* horizontal swipe owns gesture; vertical page scroll still ok */
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.prototype-panels:active {
  cursor: grabbing;
}

.prototype-panels img {
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

@media (min-width: 768px) {
  .prototype-panels {
    padding: var(--space-5);
  }
}

.prototype-panel {
  min-width: 0;
}

.prototype-panel[hidden] {
  display: none;
}

.prototype-panel.is-entering {
  animation: proto-folder-tab-swap 180ms var(--ease-out) both;
}

@keyframes proto-folder-tab-swap {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Wireframe Visual B ── */
.prototype-wf {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  padding: var(--space-3);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.prototype-wf__nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.prototype-wf__mark {
  margin-inline-end: auto;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-ink);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: #f3f5f7;
  border: 1px solid var(--color-border);
}

.prototype-wf__pill {
  display: inline-block;
  width: 36px;
  height: 10px;
  border-radius: 999px;
  background: #f3f5f7;
  border: 1px solid var(--color-border);
}

.prototype-wf__hero-grid {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

@media (min-width: 640px) {
  .prototype-wf__hero-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: stretch;
  }
}

.prototype-wf__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
  min-width: 0;
}

.prototype-wf__title {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prototype-wf__bar {
  display: block;
  height: 10px;
  border-radius: var(--radius-sm);
  background: #f3f5f7;
  border: 1px solid var(--color-border);
}

.prototype-wf__bar--lg {
  width: 92%;
  height: 14px;
  background: var(--color-ink);
  border-color: var(--color-ink);
  opacity: 0.85;
}

.prototype-wf__bar--md {
  width: 78%;
}

.prototype-wf__bar--sm {
  width: 56%;
}

.prototype-wf__bar--xs {
  width: 40%;
  height: 8px;
}

.prototype-wf__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  padding-inline: var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-on-accent, #fff);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  pointer-events: none;
}

.prototype-wf__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.prototype-wf__meta {
  display: inline-block;
  width: 64px;
  height: 18px;
  border-radius: 999px;
  background: #f3f5f7;
  border: 1px solid var(--color-border);
}

.prototype-wf__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prototype-wf__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  min-width: 0;
}

/* Cards hierarchy: middle card slightly elevated (not equal feature row without anchor) */
.prototype-wf__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #f3f5f7;
  min-width: 0;
}

.prototype-wf__card[data-slot="proto-wf-svc-card-2"] {
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.prototype-wf__price {
  display: block;
  margin-block-start: auto;
  width: 48%;
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--color-border);
}

.prototype-wf__book-grid {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

@media (min-width: 640px) {
  .prototype-wf__book-grid {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    align-items: stretch;
  }
}

.prototype-wf__steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: center;
}

.prototype-wf__step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.prototype-wf__pin {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent, #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
}

.prototype-wf__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--color-border);
}

.prototype-wf__field {
  display: block;
  height: 28px;
  border-radius: var(--radius-sm);
  background: #f3f5f7;
  border: 1px solid var(--color-border);
}

.prototype-wf__field--short {
  width: 60%;
}

/* Photo slots — sharp KIE, object-fit cover, NO blur */
.prototype-photo {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 140px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  outline: 1px solid rgb(0 0 0 / 0.1);
  background: var(--color-surface-2);
}

.prototype-photo--wide {
  aspect-ratio: 16 / 9;
  min-height: 120px;
}

.prototype-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: var(--radius-sm);
  /* HARD: no filter blur */
}

/* ── ZONE C · Dual CTA (inside .prototype-card) ── */
.prototype-card .prototype-cta {
  margin-block-start: var(--space-7);
}

.prototype-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  min-width: 0;
  padding-inline: max(0px, env(safe-area-inset-inline-start, 0px));
}

.prototype-cta__micro {
  flex: 1 1 100%;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--color-muted);
  max-width: 48rem;
}

@media (min-width: 1024px) {
  .prototype-cta {
    flex-wrap: nowrap;
  }

  .prototype-cta__micro {
    flex: 1 1 auto;
    margin-inline-start: var(--space-2);
  }
}

/* ── Motion enter ── */
@media (prefers-reduced-motion: no-preference) {
  .js-ready #prototype .prototype-zone {
    animation: proto-zone-in 0.5s var(--ease-out) both;
  }

  .js-ready #prototype .prototype-zone:nth-child(1) {
    animation-delay: 0ms;
  }

  .js-ready #prototype .prototype-zone:nth-child(2) {
    animation-delay: 80ms;
  }
}

@keyframes proto-zone-in {
  from {
    opacity: 0.92;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-ready #prototype .prototype-zone {
    animation: none;
  }

  .prototype-panel.is-entering {
    animation: none;
  }

  .prototype-tab,
  .prototype-dot,
  .prototype-tab::before,
  .prototype-dot::before {
    transition-duration: 0.01ms;
  }

  #prototype .btn {
    transition-duration: 0.01ms;
  }
}

/* ── Phone ── */
@media (max-width: 640px) {
  .prototype-specimen__title {
    padding-inline: var(--space-3);
    font-size: var(--text-base);
  }

  .prototype-specimen__badge {
    padding-inline: var(--space-3);
  }

  .prototype-tablist,
  .prototype-dots {
    margin-block: var(--space-2) var(--space-3);
    padding-inline: 0;
  }

  .prototype-wf__cards {
    grid-template-columns: 1fr;
  }

  .prototype-wf__card[data-slot="proto-wf-svc-card-2"] {
    transform: none;
  }

  .prototype-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .prototype-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .prototype-cta__micro {
    margin-inline-start: 0;
  }

  .prototype-specimen__chrome {
    padding-block: var(--space-2);
  }
}
