/* Keep the page headers in step with their matching homepage theme. */
:root { --max: 1180px; }
@media (min-width:801px) {
  .demo-banner .wrap { min-height: 48px; }
  .theme-bar .wrap { min-height: 58px; }
  .theme-bar p { font-size: .83rem; }
  .theme-button { font-size: .73rem; padding: 8px 12px; }

  /* Match the homepage's header baseline exactly in every theme. */
  .nav { min-height: 88px; gap: 20px; }
  .brand img { width: 170px; height: 64px; }
  .nav-links { gap: 22px; font: 600 .77rem var(--display); letter-spacing: .04em; }
  .button { min-height: 48px; padding: 0 18px; font: 700 .79rem var(--display); letter-spacing: .035em; }

  /* Interior-page display scales: one intentional hierarchy for each direction. */
  body[data-theme="classic"] .page-hero h1,
  body[data-theme="clean"] .page-hero h1,
  body[data-theme="emergency"] .page-hero h1 { font-size: clamp(3rem, 4.35vw, 4.65rem); }
  body[data-theme="heritage"] .page-hero h1 { font-size: clamp(3.1rem, 4.45vw, 4.8rem); }

  body[data-theme="clean"] .site-header { position: relative; border-bottom: 0; }
  body[data-theme="clean"] .nav { min-height: 106px; position: relative; justify-content: center; }
  body[data-theme="clean"] .brand { position: absolute; left: 0; }
  body[data-theme="clean"] .nav > .button { position: absolute; right: 0; border-radius: 999px; background: var(--teal); border-color: var(--teal); }

  body[data-theme="heritage"] .nav { min-height: 96px; }
  body[data-theme="heritage"] .brand img { width: 212px; height: 76px; }
  body[data-theme="heritage"] .nav .button { background: #071a34; border-color: #071a34; color: #f2c982; }

  body[data-theme="emergency"] .site-header { position: sticky; top: 0; border-bottom: 4px solid var(--gold); }
  body[data-theme="emergency"] .nav { min-height: 74px; }
  body[data-theme="emergency"] .brand img { width: 142px; height: 54px; }
  body[data-theme="emergency"] .nav > .button { min-height: 42px; }
}

/* Give each supporting page its own visual cue instead of reusing one hero photo. */
.services-page .hero-photo {
  background-image: linear-gradient(180deg, rgba(8,28,61,.08), rgba(8,28,61,.58)), url('water-damage-before-demo.png');
  background-position: center;
}
.about-page .hero-photo {
  background-image: linear-gradient(180deg, rgba(8,28,61,.03), rgba(8,28,61,.38)), url('water-damage-after-demo.png');
  background-position: center;
}
.contact-page .hero-photo { background-position: 82% center; }
.form-success { margin: 0; padding: 12px 14px; border-left: 3px solid var(--teal); background: #e8f6f6; color: var(--navy); font-size: .86rem; font-weight: 600; }
.form .button:disabled { cursor:default; opacity:.72; }

/* The Services intro needs a compact first screen, not a five-line headline. */
@media (min-width:801px) {
  .services-page .page-hero { padding: 62px 0; }
  .services-page .page-hero-grid { grid-template-columns: 1fr .82fr; gap: 54px; }
  .services-page .page-hero h1 { max-width: 690px; }
  .services-page .hero-photo { min-height: 360px; }
  .services-page .page-hero + .section { padding-top: 64px; }

  /* Clean stays spacious, but its Services page should not lose a screen to empty air. */
  body[data-theme="clean"] .services-page .page-hero { padding: 48px 0 32px; }
  body[data-theme="clean"] .services-page .page-hero + .section { padding-top: 48px; }
}

.about-next-step { display: inline-flex; align-items: center; margin-top: 23px; color: #028f91; font: 700 .82rem var(--display); letter-spacing: .035em; }
.about-next-step:hover { color: var(--navy); }
body[data-theme="heritage"] .about-next-step { color: #a65f21; }

/* Standalone Process and Our Work pages */
.process-steps .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.process-steps .card { min-height: 260px; }
.process-steps .card .num { font-size: 1.8rem; }
.work-showcase { background: #eef5f7; }
.work-comparison { --comparison: 50%; position: relative; isolation: isolate; width: min(100%,760px); aspect-ratio: 1; min-height: 0; margin: 32px auto 0; overflow: hidden; border: 1px solid var(--line); background: #e9eff0; }
.work-before,.work-after { position: absolute; inset: 0; background-position: center; background-repeat: no-repeat; background-size: cover; }
.work-after { background-image: url('water-damage-after-demo.png'); }
.work-before { width: 100%; background-image: url('water-damage-before-demo.png'); clip-path: inset(0 calc(100% - var(--comparison)) 0 0); z-index: 2; }
.work-label { position: absolute; top: 18px; z-index: 4; border-radius: 999px; padding: 7px 12px; color: #fff; font: 700 .7rem var(--display); letter-spacing: .06em; text-transform: uppercase; }
.work-label-before { left: 18px; background: var(--navy); }
.work-label-after { right: 18px; background: var(--teal); }
.work-divider { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--comparison); width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; }
.work-divider::after { content: "↔"; position: absolute; top: 50%; left: 50%; display: grid; width: 48px; height: 48px; place-items: center; border: 3px solid #fff; border-radius: 50%; background: var(--navy); color: #fff; font: 700 1.1rem var(--display); transform: translate(-50%, -50%); box-shadow: 0 2px 10px rgba(0,0,0,.28); }
.work-range { position: absolute; z-index: 6; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.work-comparison small { position: absolute; z-index: 4; right: 16px; bottom: 14px; left: 16px; color: #fff; font-size: .73rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.75); }
.project-gallery { background: #fff; }
.gallery-grid { display: grid; grid-template-columns: 1.28fr .9fr; gap: 18px; margin-top: 32px; }
.gallery-tile { position: relative; min-height: 300px; margin: 0; overflow: hidden; background-position: center; background-repeat: no-repeat; background-size: cover; }
.gallery-tile:first-child { grid-row: span 2; min-height: 618px; }
.gallery-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,transparent 55%,rgba(8,28,61,.7)); }
.gallery-tile figcaption { position: absolute; z-index: 1; right: 18px; bottom: 15px; left: 18px; color: #fff; font: 700 .82rem var(--display); }
.gallery-tile figcaption span { display: block; margin-top: 4px; color: rgba(255,255,255,.76); font: 500 .72rem var(--body); }
.gallery-tile-assessment { background-image: url('water-damage-before-demo.png'); }
.gallery-tile-drying { background-image: url('restoration-technician-demo.png'); }
.gallery-tile-result { background-image: url('water-damage-after-demo.png'); }
.work-reviews { background: #eef5f7; }
.work-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.work-review-grid article { border: 1px solid var(--line); background: #fff; padding: 28px; }
.work-review-grid blockquote { margin: 0; color: var(--navy); font: 500 1.18rem var(--display); line-height: 1.45; }
.work-review-grid cite { display: block; margin-top: 22px; color: var(--muted); font-size: .83rem; font-style: normal; }
.work-review-note { margin: 16px 0 0; color: var(--muted); font-size: .78rem; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-top: 32px; }
.detail-grid article { border-top: 3px solid var(--teal); padding: 22px 4px 0; }
.detail-grid strong { color: var(--navy); font: 700 1.12rem var(--display); }
.detail-grid p { margin: 12px 0 0; color: var(--muted); }
.process-question { background: #f8efe3; }
.process-question .button { width: max-content; align-self: center; }
body[data-theme="clean"] .work-showcase { background: #fff; }
body[data-theme="heritage"] .work-showcase { background: #071a34; }
body[data-theme="heritage"] .work-showcase h2,body[data-theme="heritage"] .work-showcase .lede { color: #f8f2e7; }
body[data-theme="emergency"] .work-showcase { background: #fff; }
body[data-theme="heritage"] .process-steps .card { border-color: #cbb98f; }
body[data-theme="clean"] .project-gallery { background: #f2f9f9; }
body[data-theme="heritage"] .project-gallery { background: #faf7f1; }
body[data-theme="heritage"] .work-reviews { background: #071a34; }
body[data-theme="heritage"] .work-review-grid article { background: #0e2749; border-color: rgba(242,201,130,.4); }
body[data-theme="heritage"] .work-review-grid blockquote { color: #f8f2e7; font-family: "DM Serif Display", Georgia, serif; }
body[data-theme="heritage"] .work-review-grid cite,body[data-theme="heritage"] .work-review-note { color: #d7c7af; }
body[data-theme="heritage"] .process-detail { background: #faf7f1; }
body[data-theme="heritage"] .detail-grid article { border-color: #a65f21; }
body[data-theme="heritage"] .process-question { background: #ece2d5; }
body[data-theme="emergency"] .work-reviews { background: #f4f6f8; }
body[data-theme="emergency"] .detail-grid article { border-color: var(--gold); }
body[data-theme="emergency"] .process-question { background: #081c3d; }
body[data-theme="emergency"] .process-question h2,body[data-theme="emergency"] .process-question p { color: #fff; }

@media(max-width:800px) {
  .process-steps .cards { grid-template-columns: 1fr; }
  .process-steps .card { min-height: 0; }
  .work-comparison { width: 100%; aspect-ratio: 1; min-height: 0; margin-top: 24px; }
  .gallery-grid,.detail-grid,.work-review-grid { grid-template-columns: 1fr; }
  .gallery-tile,.gallery-tile:first-child { min-height: 265px; }
  .process-question .button { width: 100%; }
}
