/**
 * HealthN.E.S.S. — Visual foundation layer (Phase 1)
 * Artifacts, alignment, media staging, finale CTAs.
 * Preserves brand identity and approved hero. No redesign — craftsmanship.
 */

:root {
  --hn-panel-bg:
    linear-gradient(180deg, rgba(36, 34, 28, 0.42), rgba(22, 23, 22, 0.92));
  --hn-panel-border: rgba(153, 144, 124, 0.28);
  --hn-panel-border-active: rgba(242, 202, 80, 0.48);
  --hn-panel-radius: var(--radius-default, 0.25rem);
  --hn-edge-gold: linear-gradient(180deg, rgba(242, 202, 80, 0.18), rgba(242, 202, 80, 0.55));
  --hn-prose: var(--width-prose, 42rem);
  --hn-prose-narrow: var(--width-narrow, 36rem);
  --vf-rail: var(--width-container-max, 72rem);
  --vf-gutter: var(--space-gutter, 1.5rem);
  --vf-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --vf-glow: rgba(242, 202, 80, 0.14);
  --vf-depth: rgba(0, 0, 0, 0.45);
}

/* —— Shared panel —— */
.hn-panel {
  position: relative;
  border: 1px solid var(--hn-panel-border);
  border-radius: var(--hn-panel-radius);
  background: var(--hn-panel-bg);
}

.hn-panel--edge::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hn-edge-gold);
  opacity: 0.7;
}

/* —— Global rail / measure —— */
.vf-rail {
  width: 100%;
  max-width: var(--vf-rail);
  margin-inline: auto;
  padding-inline: var(--vf-gutter);
}

.vf-measure {
  max-width: var(--hn-prose);
}

.vf-measure--narrow {
  max-width: var(--hn-prose-narrow);
}

/* Section atmosphere (connected story flow — not random glow) */
.chapter.ambient-deep,
.chapter.ambient-base,
.chapter.ambient-lit,
.chapter.ambient-action {
  position: relative;
}

.chapter.ambient-deep::after,
.chapter.ambient-lit::after,
.chapter.ambient-action::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.9;
}

.chapter.ambient-deep::after {
  background:
    radial-gradient(ellipse 50% 40% at 8% 20%, rgba(242, 202, 80, 0.05), transparent 60%),
    radial-gradient(ellipse 40% 35% at 92% 80%, rgba(211, 197, 173, 0.04), transparent 65%);
}

.chapter.ambient-lit::after {
  background:
    radial-gradient(ellipse 55% 45% at 50% 0%, rgba(242, 202, 80, 0.07), transparent 55%);
}

.chapter.ambient-action::after {
  background:
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(242, 202, 80, 0.1), transparent 60%),
    radial-gradient(ellipse 40% 40% at 15% 30%, rgba(242, 202, 80, 0.05), transparent 55%);
}

.chapter > * {
  position: relative;
  z-index: 1;
}

/* —— Media frames / Higgsfield slots —— */
.hn-media-frame,
.vf-media {
  position: relative;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--hn-panel-border);
  border-radius: var(--hn-panel-radius);
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(242, 202, 80, 0.1), transparent 55%),
    linear-gradient(160deg, #1a1814 0%, #0a0b0a 55%, #12100c 100%);
  box-shadow:
    inset 0 0 0 1px rgba(242, 202, 80, 0.08),
    0 18px 40px var(--vf-depth);
  aspect-ratio: 16 / 10;
}

.hn-media-frame[data-aspect="16x9"],
.vf-media[data-aspect="16x9"] {
  aspect-ratio: 16 / 9;
}

.hn-media-frame[data-aspect="4x5"],
.vf-media[data-aspect="4x5"] {
  aspect-ratio: 4 / 5;
}

.hn-media-frame[data-aspect="9x16"],
.vf-media[data-aspect="9x16"] {
  aspect-ratio: 9 / 16;
  max-width: 18rem;
  margin-inline: auto;
}

.hn-media-frame[data-aspect="21x9"],
.vf-media[data-aspect="21x9"] {
  aspect-ratio: 21 / 9;
}

.hn-media-frame__fallback,
.vf-media__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.4rem;
  padding: 1.35rem 1.4rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(242, 202, 80, 0.08), transparent 50%);
}

.hn-media-frame__label,
.vf-media__label {
  font-family: var(--font-label);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.hn-media-frame__note,
.vf-media__note {
  margin: 0;
  max-width: 28ch;
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-on-surface-variant);
}

.hn-media-frame img,
.hn-media-frame video,
.vf-media img,
.vf-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Browser artifact */
.vf-browser {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(77, 70, 53, 0.55);
  border-radius: 0.75rem;
  background: #0a0b0a;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4);
}

.vf-browser__chrome {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: #161816;
  border-bottom: 1px solid rgba(77, 70, 53, 0.4);
}

.vf-browser__chrome span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: rgba(211, 197, 173, 0.35);
}

.vf-browser__chrome i {
  flex: 1;
  height: 0.55rem;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.vf-browser__screen {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #101211;
}

.vf-browser__screen img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.92) contrast(1.05);
}

/* Phone artifact */
.vf-phone {
  width: min(100%, 11rem);
  margin-inline: auto;
  padding: 0.55rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(242, 202, 80, 0.28);
  background: linear-gradient(160deg, #1c1e1c, #0a0b0a);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.vf-phone__screen {
  overflow: hidden;
  border-radius: 1rem;
  aspect-ratio: 9 / 16;
  background: #0c0d0c;
}

.vf-phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Finale CTA — final scene, not grey box */
.vf-finale,
.svc-cta__panel,
.insight-cta__panel,
.about-cta__panel,
.faq-cta__panel,
.work-cta__panel,
.contact-premium {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.vf-finale,
.svc-cta__panel,
.insight-cta__panel,
.about-cta__panel,
.faq-cta__panel,
.work-cta__panel {
  padding: clamp(1.85rem, 4.5vw, 3rem);
  border: 1px solid rgba(242, 202, 80, 0.28);
  border-radius: 1.15rem;
  background:
    radial-gradient(ellipse 70% 80% at 8% 0%, rgba(242, 202, 80, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 60% at 100% 100%, rgba(211, 197, 173, 0.06), transparent 55%),
    linear-gradient(165deg, rgba(28, 26, 22, 0.95), rgba(12, 13, 12, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(242, 202, 80, 0.12),
    0 28px 70px rgba(0, 0, 0, 0.35);
}

.vf-finale::before,
.svc-cta__panel::before,
.insight-cta__panel::before,
.about-cta__panel::before,
.faq-cta__panel::before,
.work-cta__panel::before,
.contact-premium::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: min(50%, 22rem);
  height: min(70%, 18rem);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 202, 80, 0.16), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.vf-finale > *,
.svc-cta__panel > *,
.insight-cta__panel > *,
.about-cta__panel > *,
.faq-cta__panel > *,
.work-cta__panel > *,
.contact-premium > * {
  position: relative;
  z-index: 1;
}

.contact-premium {
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  border: 1px solid rgba(242, 202, 80, 0.28);
  border-radius: 1.15rem;
  background:
    radial-gradient(ellipse 60% 70% at 0% 0%, rgba(242, 202, 80, 0.12), transparent 50%),
    linear-gradient(165deg, rgba(28, 26, 22, 0.92), rgba(12, 13, 12, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(242, 202, 80, 0.1),
    0 24px 60px rgba(0, 0, 0, 0.32);
}

/* —— Perception Gap —— */
.gap-contrast {
  display: grid;
  gap: 1rem;
  margin: 0 auto clamp(1.5rem, 3.5vw, 2.25rem);
  max-width: 52rem;
}

@media (min-width: 768px) {
  .gap-contrast {
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 0;
  }
}

.gap-contrast__side {
  padding: 1.35rem 1.35rem 1.45rem;
  border: 1px solid var(--hn-panel-border);
  border-radius: var(--hn-panel-radius);
  background: var(--hn-panel-bg);
}

.gap-contrast__side--strong {
  border-color: rgba(242, 202, 80, 0.32);
  background:
    radial-gradient(ellipse 70% 80% at 0% 0%, rgba(242, 202, 80, 0.1), transparent 55%),
    var(--hn-panel-bg);
}

.gap-contrast__side--weak {
  border-color: rgba(153, 144, 124, 0.35);
  opacity: 0.96;
}

.gap-contrast__label {
  display: block;
  margin: 0 0 0.65rem;
  font-family: var(--font-label);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-primary);
}

.gap-contrast__side--weak .gap-contrast__label {
  color: var(--color-champagne-gold);
}

.gap-contrast__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--color-on-background);
}

.gap-contrast__text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-on-surface-variant);
}

.gap-contrast__divider {
  display: none;
}

@media (min-width: 768px) {
  .gap-contrast__divider {
    display: grid;
    place-items: center;
    width: 3.25rem;
    font-family: var(--font-label);
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary);
  }

  .gap-contrast__side {
    border-radius: 0;
  }

  .gap-contrast__side--strong {
    border-right: 0;
  }

  .gap-contrast__side--weak {
    border-left: 0;
  }
}

.gap-signals {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  max-width: 52rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .gap-signals {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .gap-signals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cine-gap .gap-signals li {
  position: relative;
}

/* Keep non-cinematic consumers intact if any remain */
.gap-signals:not(:has(.gap-signal)) li {
  position: relative;
  padding: 1rem 1.1rem 1.05rem 1.2rem;
  border: 1px solid var(--hn-panel-border);
  border-radius: var(--hn-panel-radius);
  background: var(--hn-panel-bg);
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--color-on-surface-variant);
}

.gap-signals li strong {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--color-on-background);
}

.gap-signals__caption {
  margin: 1.15rem auto 0;
  max-width: 40rem;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-on-surface-variant);
}

/* —— Needs —— */
.needs-foundation:not(.cine-system__nodes) {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: grid;
  gap: 0.85rem;
  max-width: 56rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .needs-foundation:not(.cine-system__nodes) {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .needs-foundation:not(.cine-system__nodes) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.needs-foundation:not(.cine-system__nodes) li {
  position: relative;
  min-height: 100%;
  padding: 1.2rem 1.2rem 1.25rem 1.3rem;
  border: 1px solid var(--hn-panel-border);
  border-radius: var(--hn-panel-radius);
  background: var(--hn-panel-bg);
}

.needs-foundation:not(.cine-system__nodes) li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--hn-edge-gold);
  opacity: 0.75;
}

.needs-foundation:not(.cine-system__nodes) strong {
  display: block;
  margin: 0 0 0.4rem;
  font-family: var(--font-heading);
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--color-on-background);
}

.needs-foundation:not(.cine-system__nodes) span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-on-surface-variant);
}

/* —— Homepage pillars: aperture strip —— */
.home-pillar {
  position: relative;
  overflow: hidden;
}

.home-pillar::before {
  content: "";
  display: block;
  height: 4.5rem;
  margin: -1.5rem -1.35rem 1rem;
  border-bottom: 1px solid rgba(77, 70, 53, 0.4);
  background:
    radial-gradient(ellipse 80% 120% at 30% 80%, rgba(242, 202, 80, 0.18), transparent 55%),
    linear-gradient(160deg, #1a1814, #0a0b0a);
}

.home-pillar:nth-child(1)::before {
  background:
    radial-gradient(circle at 40% 60%, rgba(242, 202, 80, 0.22), transparent 45%),
    linear-gradient(160deg, #1c1810, #080807);
}

.home-pillar:nth-child(2)::before {
  background:
    linear-gradient(115deg, transparent 30%, rgba(242, 202, 80, 0.12) 48%, transparent 62%),
    linear-gradient(160deg, #171612, #080807);
}

.home-pillar:nth-child(3)::before {
  background:
    radial-gradient(circle at 70% 40%, rgba(211, 197, 173, 0.14), transparent 40%),
    linear-gradient(160deg, #141614, #080807);
}

.home-pillar:nth-child(4)::before {
  background:
    radial-gradient(circle at 50% 50%, rgba(242, 202, 80, 0.16), transparent 36%),
    radial-gradient(circle at 75% 30%, rgba(90, 130, 180, 0.1), transparent 40%),
    linear-gradient(160deg, #0d1014, #050607);
}

a.home-pillar:hover::before,
a.home-pillar:focus-visible::before {
  filter: brightness(1.15);
}

/* —— Process journey connectors (strengthen existing) —— */
.home-process-path {
  position: relative;
}

/* Desktop connector owned by cinematic.css (horizontal rail).
   Keep mobile vertical guide only below 900px. */
@media (max-width: 899px) {
  .home-process-path::before {
    content: "";
    position: absolute;
    left: 1.55rem;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 1px;
    background: linear-gradient(
      180deg,
      rgba(242, 202, 80, 0.05),
      rgba(242, 202, 80, 0.35) 20%,
      rgba(242, 202, 80, 0.35) 80%,
      rgba(242, 202, 80, 0.05)
    );
    pointer-events: none;
  }
}

@media (min-width: 900px) {
  .home-process-path::before {
    content: none;
  }
}

.home-process-step {
  position: relative;
}

/* —— Homepage about bridge media —— */
.home-about {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .home-about {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  .home-about__visual {
    order: 2;
  }
}

.home-about__visual {
  position: relative;
}

.home-about__visual .vf-media {
  aspect-ratio: 4 / 5;
  max-width: 22rem;
}

@media (max-width: 899px) {
  .home-about__visual .vf-media {
    aspect-ratio: 16 / 10;
    max-width: none;
  }
}

/* Intro rhythm */
.home-scan-intro h2 {
  max-width: 22ch;
}

.home-scan-intro.text-center h2,
.home-scan-intro.text-center .home-scan-support {
  margin-left: auto;
  margin-right: auto;
}

.home-scan-support {
  max-width: var(--hn-prose-narrow);
}

/* Proof media with real images — browser chrome companion */
.proof-media.vf-browser {
  border: 0;
  background: transparent;
  aspect-ratio: auto;
  min-height: 0;
}

.proof-media.vf-browser .vf-browser__screen {
  aspect-ratio: 16 / 10;
}

.proof-media--support.vf-browser .vf-browser__screen {
  aspect-ratio: 5 / 4;
}

.proof-support-item:nth-child(2) .proof-media--support.vf-browser .vf-browser__screen {
  aspect-ratio: 4 / 5;
}

@media (max-width: 767px) {
  .proof-support-item:nth-child(2) .proof-media--support.vf-browser .vf-browser__screen {
    aspect-ratio: 16 / 10;
  }
}

/* FAQ knowledge environment */
.faq-page .faq-section,
.faq-preview .faq-list {
  position: relative;
}

.faq-page .faq-layout {
  max-width: var(--vf-rail);
}

.faq-page main,
.faq-page .faq-main {
  position: relative;
}

.faq-page .faq-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 28rem;
  pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 12% 10%, rgba(242, 202, 80, 0.06), transparent 65%);
}

/* Insights editorial destination — polish owned by insights.css */
.insight-soon__panel {
  position: relative;
  overflow: hidden;
}

/* Work archive cards — premium staging */
.work-page .work-card,
.work-archive .work-card {
  position: relative;
}

/* Sharper shared radii */
.home-scan-card,
.needs-grid li,
.home-pillar,
.home-process-step,
.contact-premium,
.faq-item,
.insight-soon__panel {
  border-radius: var(--hn-panel-radius);
}

/* Mobile gutters / overflow */
@media (max-width: 767px) {
  .vf-browser,
  .vf-media,
  .hn-media-frame {
    max-width: 100%;
  }

  .proof-support-grid,
  .proof-support-item,
  .proof-media.vf-browser,
  .proof-feature,
  .proof-feature__media,
  .proof-device-pair {
    max-width: 100%;
    min-width: 0;
  }

  .proof-support-item .proof-media--support.vf-browser,
  .proof-support-item .vf-browser__screen {
    width: 100%;
    max-width: 100%;
  }

  .proof-meta {
    max-width: 100%;
    flex-wrap: wrap;
  }

  #work,
  .proof-support-grid,
  .proof-feature__layout,
  main {
    overflow-x: clip;
  }

  .chapter.ambient-deep::after,
  .chapter.ambient-lit::after,
  .chapter.ambient-action::after {
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hn-panel,
  .gap-signals li,
  .needs-foundation li,
  .home-pillar::before,
  .vf-finale::before,
  .svc-cta__panel::before,
  .contact-premium::before {
    transition: none !important;
    filter: none !important;
  }
}
