/* Structural and presentation corrections loaded after the main stylesheet. */

html { scroll-padding-top: 88px; }
body.menu-open { overflow: hidden; }
[hidden] { display: none !important; }

/* Keep the navigation stable where backdrop filters are not supported. */
@supports not (backdrop-filter: blur(12px)) {
  #nav { background: rgba(250, 247, 240, .98); }
}

/* Portrait: use Felix's actual image in colour, at a useful size, with a safe fallback. */
.portrait-card { margin: 0; }
.portrait {
  position: relative;
  width: min(285px, 84%);
  aspect-ratio: 1 / 1;
  overflow: visible;
  isolation: isolate;
  background: linear-gradient(145deg, var(--navy-3, #143149), var(--navy-2));
}
.portrait::after { z-index: -1; }
.portrait img,
.portrait-image {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 22%;
  filter: none !important;
  background: var(--navy-2);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
}
.portrait-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 0;
  border-radius: 18px;
  color: var(--amber);
  font-family: var(--serif);
  font-size: 3rem;
  background: var(--navy-2);
}
.portrait.image-ready .portrait-fallback { display: none; }
.portrait.image-error img { display: none; }
.portrait-caption {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 24px;
  color: #f2f6f9;
  font-weight: 700;
  line-height: 1.35;
}
.portrait-caption br { display: none; }
.portrait-caption span {
  display: block;
  color: #9fb0bd;
  font-size: .84rem;
  font-weight: 500;
}
.stat-num { overflow-wrap: anywhere; }

/* Cards and calls to action line up cleanly instead of ending at uneven heights. */
.service-card { display: flex; flex-direction: column; }
.service-card .check-list { flex: 1; }
.service-card .text-link { margin-top: auto; padding-top: 14px; }
.case-card { display: flex; flex-direction: column; }
.case-card .mini-metrics { margin-top: auto; padding-top: 22px; }
.process-grid article { height: 100%; }

/* Mobile navigation behaviour and stacking. */
@media (max-width: 760px) {
  .nav-links { z-index: 80; max-height: calc(100vh - 86px); overflow-y: auto; }
  .portrait { width: min(245px, 78vw); }
  .hero-side {
    display: grid;
    grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    gap: 24px;
    align-items: start;
  }
  .hero-stats { margin-top: 0; }
  .stat { padding-top: 12px; }
  .service-top { align-items: baseline; }
  .form-layout { gap: 36px; }
}

@media (max-width: 520px) {
  .hero-side { grid-template-columns: 1fr; }
  .portrait { width: min(265px, 86vw); }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .service-top { flex-direction: column; gap: 2px; }
  .service-price { white-space: normal; }
  .mini-metrics { grid-template-columns: 1fr; }
  .footer-grid a { overflow-wrap: anywhere; }
}

/* Form and privacy refinements. */
.consent a { color: var(--amber-deep); }
.consent a:hover { text-decoration-thickness: 2px; }
.intake-form input[type="file"] { background: #fff; }
.form-note { line-height: 1.5; }
.legal-copy { max-width: 760px; }

/* Consistent confirmation page instead of an isolated layout. */
.confirmation-page {
  min-height: calc(100vh - 70px);
  background: radial-gradient(circle at 80% 0%, rgba(240,178,62,.18), transparent 38%), var(--navy);
}
.confirmation-wrap {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 72px 24px;
}
.confirmation-page .success-card { width: min(100%, 720px); }
.confirmation-page + footer { padding-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .btn, .card, .service-card { transition: none !important; }
}
