/* v9: hero morph (idea, plan, live), ring label fix, legal and error pages in the dark world. */

/* The 74% label sits in the middle of its ring. */
.sys .ui .ui-ring-label {
  text-anchor: middle;
  dominant-baseline: central;
}

/* Hero morph: the same seven blocks travel from scattered idea notes to a wireframe to a live screen. */

.morph .flow-head {
  flex-wrap: wrap;
}

.morph-steps {
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  list-style: none;
}

.morph-steps li {
  padding: 4px 10px;
  border-radius: 99px;
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 700;
  transition: color 300ms ease, background-color 300ms ease;
}

.morph[data-state="idea"] [data-step="idea"],
.morph[data-state="plan"] [data-step="plan"],
.morph[data-state="live"] [data-step="live"] {
  background: rgba(199, 168, 107, 0.16);
  color: var(--gold);
}

.morph-canvas {
  position: relative;
  margin: 18px 0 14px;
  aspect-ratio: 600 / 330;
  container-type: inline-size;
}

.mb {
  /* Live and plan share the grid layout; idea scatters the blocks like notes on a desk. */
  --l: 0%;
  --t: 0%;
  --w: 10%;
  --h: 10%;
  --r: 0deg;
  position: absolute;
  left: var(--l);
  top: var(--t);
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #1b222c;
  box-shadow: inset 0 0 0 1px rgba(244, 240, 232, 0.07);
  transform: rotate(var(--r));
  transition:
    left 900ms var(--ease-io),
    top 900ms var(--ease-io),
    width 900ms var(--ease-io),
    height 900ms var(--ease-io),
    transform 900ms var(--ease-io),
    background-color 500ms ease,
    border-color 500ms ease,
    box-shadow 500ms ease;
  transition-delay: calc(var(--n, 0) * 50ms);
}

.mb-nav { --n: 0; --l: 0%; --t: 0%; --w: 100%; --h: 13%; }
.mb-side { --n: 1; --l: 0%; --t: 17%; --w: 19%; --h: 83%; }
.mb-k1 { --n: 2; --l: 22%; --t: 17%; --w: 24.6%; --h: 24%; }
.mb-k2 { --n: 3; --l: 48.7%; --t: 17%; --w: 24.6%; --h: 24%; }
.mb-k3 { --n: 4; --l: 75.4%; --t: 17%; --w: 24.6%; --h: 24%; }
.mb-chart { --n: 5; --l: 22%; --t: 45%; --w: 51.3%; --h: 55%; }
.mb-list { --n: 6; --l: 75.4%; --t: 45%; --w: 24.6%; --h: 55%; }

.morph[data-state="idea"] .mb-nav { --l: 4%; --t: 4%; --w: 24%; --h: 17%; --r: -4deg; }
.morph[data-state="idea"] .mb-side { --l: 70%; --t: 2%; --w: 26%; --h: 19%; --r: 5deg; }
.morph[data-state="idea"] .mb-k1 { --l: 36%; --t: 9%; --w: 24%; --h: 18%; --r: -2deg; }
.morph[data-state="idea"] .mb-k2 { --l: 3%; --t: 42%; --w: 26%; --h: 18%; --r: 3deg; }
.morph[data-state="idea"] .mb-k3 { --l: 70%; --t: 38%; --w: 26%; --h: 18%; --r: -5deg; }
.morph[data-state="idea"] .mb-chart { --l: 33%; --t: 40%; --w: 32%; --h: 24%; --r: 2deg; }
.morph[data-state="idea"] .mb-list { --l: 40%; --t: 74%; --w: 28%; --h: 18%; --r: -3deg; }

.morph[data-state="idea"] .mb {
  border-color: rgba(199, 168, 107, 0.6);
  border-style: dashed;
  background: rgba(199, 168, 107, 0.08);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.8);
}

.morph[data-state="plan"] .mb {
  border-color: rgba(244, 240, 232, 0.24);
  background: rgba(244, 240, 232, 0.02);
  box-shadow: none;
}

/* Each block carries three faces; only the one for the current state shows. */

.mb-idea,
.mb-plan,
.mb-live {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: blur(4px);
  transition:
    opacity 400ms ease,
    filter 400ms ease;
}

.morph[data-state="idea"] .mb-idea,
.morph[data-state="plan"] .mb-plan,
.morph[data-state="live"] .mb-live {
  opacity: 1;
  filter: none;
  transition-delay: 450ms;
}

.mb-idea {
  display: grid;
  place-items: center;
  padding: 4px;
  color: var(--gold);
  font-size: clamp(0.6rem, 2.1cqw, 0.86rem);
  font-weight: 650;
  text-align: center;
  line-height: 1.2;
}

.mb-plan {
  padding: 7% 8%;
  display: grid;
  align-content: start;
  gap: 6px;
  color: rgba(244, 240, 232, 0.5);
  font-size: clamp(0.5rem, 1.6cqw, 0.66rem);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mb-plan i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(244, 240, 232, 0.12);
}

.mb-plan i:nth-of-type(2) {
  width: 70%;
}

.mb-plan i:nth-of-type(3) {
  width: 50%;
}

/* Live faces */

.lv-nav {
  padding: 0 3%;
  display: flex;
  align-items: center;
  gap: 2%;
  font-size: clamp(0.56rem, 1.9cqw, 0.78rem);
}

.lv-tile {
  width: 3.4cqw;
  height: 3.4cqw;
  border-radius: 6px;
  background: var(--gold);
}

.lv-nav b {
  font-weight: 720;
}

.lv-pill {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(199, 168, 107, 0.2);
  color: var(--gold);
  font-size: 0.9em;
  font-weight: 700;
}

.lv-side {
  padding: 18% 14%;
  display: grid;
  align-content: start;
  gap: 9%;
}

.lv-side i {
  display: block;
  height: 1.4cqw;
  min-height: 5px;
  border-radius: 4px;
  background: rgba(244, 240, 232, 0.14);
}

.lv-side i.is-on {
  background: var(--gold);
}

.lv-kpi {
  padding: 8% 10%;
  display: grid;
  align-content: center;
  gap: 2px;
}

.lv-kpi span {
  color: rgba(244, 240, 232, 0.55);
  font-size: clamp(0.5rem, 1.6cqw, 0.68rem);
  font-weight: 650;
}

.lv-kpi b {
  font-size: clamp(0.85rem, 3.4cqw, 1.4rem);
  font-weight: 760;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.lv-chart {
  padding: 5% 5% 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
}

.lv-chart span {
  color: rgba(244, 240, 232, 0.55);
  font-size: clamp(0.5rem, 1.6cqw, 0.68rem);
  font-weight: 650;
}

.lv-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lv-area {
  fill: rgba(199, 168, 107, 0.16);
}

.lv-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1400ms var(--ease-settle) 600ms;
}

.morph[data-state="live"] .lv-line {
  stroke-dashoffset: 0;
}

.lv-list {
  padding: 12% 10%;
  display: grid;
  align-content: start;
  gap: 14%;
}

.lv-list p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8%;
}

.lv-list i {
  flex: none;
  width: 2.6cqw;
  height: 2.6cqw;
  border-radius: 50%;
  background: rgba(199, 168, 107, 0.4);
}

.lv-list span {
  flex: 1;
  height: 1.2cqw;
  min-height: 4px;
  border-radius: 4px;
  background: rgba(244, 240, 232, 0.16);
}

.morph-bar {
  height: 2px;
  margin-bottom: 4px;
  border-radius: 2px;
  background: rgba(244, 240, 232, 0.08);
  overflow: hidden;
}

.morph-bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  transform-origin: left;
  transform: scaleX(0);
}

@media (prefers-reduced-motion: reduce) {
  .mb,
  .mb-idea,
  .mb-plan,
  .mb-live,
  .lv-line {
    transition: none;
  }
}

/* Legal and error pages */

.legal {
  min-height: 100svh;
  padding-block: 150px 100px;
  display: grid;
  align-content: start;
}

.legal-surface {
  max-width: 760px;
  padding: clamp(28px, 4vw, 56px);
}

.legal-surface h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 720;
  line-height: 1;
  letter-spacing: -0.035em;
}

.legal-lead {
  margin-top: 20px;
  color: var(--text-2);
  font-size: 1.08rem;
}

.legal-status {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.legal-status strong {
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 720;
}

.legal-status p {
  margin-top: 8px;
  color: var(--text-2);
}

.legal-back {
  margin-top: 32px;
  display: inline-block;
}

.error-code {
  color: var(--gold);
  font-size: clamp(5rem, 16vw, 11rem);
  font-weight: 760;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.error-page .legal-surface h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.error-page .hero-actions {
  margin-top: 32px;
}
