/*
 * Product refinement layer
 *
 * Final layout treatment for the 3D product demo, measured-output cards,
 * featured pricing, and FAQ. This file intentionally loads last.
 */

/* Product demo: keep the real GLB prominent without letting it dominate the section. */
.product-demo-stage .landscape-phone-stage,
.product-demo-phone-host .landscape-phone-stage {
  width: min(720px, 68vw);
  margin-inline: auto;
}

.product-demo-phone-host .product-demo-phone-3d {
  inset: -11% -3%;
}

.product-demo-phone-host .product-demo-phone-3d::before {
  right: 18%;
  bottom: 13%;
  left: 18%;
  height: 28px;
  filter: blur(21px);
  opacity: 0.5;
}

/* Metrics: heading → instruments → footnote, one shared vertical rhythm. */
.metrics-section .section-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 4.8vw, 64px);
}

.metrics-heading {
  position: static;
  width: min(900px, 100%);
  max-width: none;
  margin-inline: auto;
  text-align: center;
}

.metrics-heading .expressive-heading {
  justify-content: center;
  max-width: 900px;
  margin-inline: auto;
}

.metrics-footnote {
  width: min(560px, 100%);
  max-width: 54ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.65;
  text-align: center;
  text-wrap: pretty;
}

.metric-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 24px);
  width: min(1120px, 100%);
  margin-inline: auto;
  border: 0;
}

.metric-row {
  position: relative;
  isolation: isolate;
  display: flex;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0 !important;
  padding: clamp(24px, 2.8vw, 38px);
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 42%),
    #090a0c;
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition:
    border-color 220ms ease-out,
    background-color 220ms ease-out,
    box-shadow 220ms ease-out,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.metric-row:hover,
.metric-row:focus-within {
  border-color: rgba(255, 255, 255, 0.28);
  background-color: #0d0e10;
  box-shadow:
    0 30px 66px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transform: translateY(-5px);
}

.metric-code {
  color: rgba(255, 255, 255, 0.96);
  font-family: var(--display);
  font-size: clamp(48px, 5.6vw, 78px);
  font-weight: 680;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.metric-row > strong {
  position: absolute;
  top: clamp(25px, 2.8vw, 38px);
  right: clamp(24px, 2.8vw, 38px);
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.metric-row > div {
  width: 100%;
  margin: auto 0 0;
}

.metric-row h3 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 0.98;
}

.metric-row p {
  max-width: 32ch;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  line-height: 1.58;
}

/* Pricing: a faint neutral halo marks Pro without breaking the monochrome system. */
.pricing-plan.is-featured {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 46px rgba(255, 255, 255, 0.075),
    0 30px 72px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.pricing-plan.is-featured:hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 58px rgba(255, 255, 255, 0.105),
    0 34px 82px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* FAQ: native disclosure rows, quiet hierarchy, no dashboard chrome. */
#faq {
  scroll-margin-top: 88px;
}

.faq-section {
  background: #08090b;
}

.faq-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.68fr) minmax(0, 1.32fr);
  align-items: start;
  gap: clamp(58px, 9vw, 146px);
}

.faq-heading {
  position: sticky;
  top: 118px;
}

.faq-heading h2 {
  max-width: 8ch;
  font-size: clamp(48px, 5.6vw, 80px);
}

.faq-heading p {
  max-width: 38ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.68;
}

.faq-list {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.faq-item summary {
  position: relative;
  display: flex;
  min-height: 92px;
  padding: 26px 58px 26px 0;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-family: var(--display);
  font-size: clamp(19px, 1.65vw, 24px);
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.25;
  list-style: none;
  transition: color 180ms ease-out;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-50%);
  transition:
    color 180ms ease-out,
    background-color 180ms ease-out,
    border-color 180ms ease-out,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-item summary:hover,
.faq-item summary:focus-visible {
  color: #ffffff;
}

.faq-item summary:hover::after,
.faq-item summary:focus-visible::after {
  border-color: rgba(255, 255, 255, 0.38);
  color: #050505;
  background: #ffffff;
}

.faq-item[open] summary::after {
  content: "–";
  color: #050505;
  background: #ffffff;
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  max-width: 68ch;
  margin: -5px 0 0;
  padding: 0 58px 30px 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 15px;
  line-height: 1.72;
}

@media (max-width: 980px) {
  .product-demo-stage .landscape-phone-stage,
  .product-demo-phone-host .landscape-phone-stage {
    width: min(640px, 74vw);
  }

  .faq-shell {
    grid-template-columns: 1fr;
    gap: 54px;
  }

  .faq-heading {
    position: static;
    max-width: 780px;
  }

  .faq-heading h2 {
    max-width: 12ch;
  }
}

@media (max-width: 820px) {
  .product-demo-stage .landscape-phone-stage,
  .product-demo-phone-host .landscape-phone-stage {
    width: min(560px, 82vw);
  }

  .product-demo-phone-host .product-demo-phone-3d {
    inset: -8% -2%;
  }

  .metrics-heading .expressive-heading {
    justify-items: center;
  }

  .metric-rail {
    gap: 14px;
  }

  .metric-row {
    padding: 22px;
    border-radius: 20px;
  }

  .metric-code {
    font-size: clamp(38px, 7vw, 58px);
  }

  .metric-row > strong {
    top: 23px;
    right: 22px;
    font-size: 8px;
  }

  .metric-row h3 {
    font-size: clamp(22px, 3.7vw, 32px);
  }

  .metric-row p {
    margin-top: 12px;
    font-size: 12.5px;
  }
}

@media (max-width: 700px) {
  .metric-rail {
    grid-template-columns: 1fr;
    width: min(440px, 100%);
  }

  .metric-row {
    aspect-ratio: 1;
  }
}

@media (max-width: 560px) {
  #faq {
    scroll-margin-top: 78px;
  }

  .product-demo-phone-host .landscape-phone-stage {
    width: 100%;
  }

  .product-demo-phone-host .product-demo-phone-3d {
    inset: -6% 0;
  }

  .metrics-footnote {
    font-size: 14px;
  }

  .faq-shell {
    gap: 42px;
  }

  .faq-item summary {
    min-height: 80px;
    padding: 22px 50px 22px 0;
    font-size: 18px;
  }

  .faq-item summary::after {
    width: 31px;
    height: 31px;
    font-size: 16px;
  }

  .faq-answer {
    padding: 0 0 26px;
    font-size: 14px;
  }
}

@media (hover: none) {
  .metric-row:hover,
  .pricing-plan.is-featured:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .metric-row,
  .faq-item summary,
  .faq-item summary::after {
    transition: none;
  }
}