/*
  Consolidated Pagivo tuning demo layer.
  This file replaces the old competing transform/assets/video/effect overlay stack for
  beispiel-website-realistisch.html. The page now uses the base stylesheet plus
  body[data-demo-state="before|after"] and body.is-transforming; no hidden hero video is loaded.
*/
:root {
  --demo-before-blue: #385267;
  --demo-before-line: #d9d3c8;
  --demo-after-ink: #071426;
  --demo-after-blue: #073b63;
  --demo-after-cyan: #e7f7ff;
  --demo-after-gold: #f4a62a;
}

body[data-demo-state] {
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

/* BEFORE: plausible and average, without artificially devaluing imagery. */
body[data-demo-state="before"] {
  background: #f8f5ed;
  color: #2f3336;
}

body[data-demo-state="before"] .demo-note {
  background: #4c4a45;
  color: #f2eee5;
}


body[data-demo-state] a:focus-visible,
body[data-demo-state] button:focus-visible,
body[data-demo-state] [role="textbox"]:focus-visible {
  outline: 3px solid #0c6fd4;
  outline-offset: 3px;
}

body[data-demo-state] .reviews a:focus-visible,
body[data-demo-state] .site-footer a:focus-visible,
body[data-demo-state] .tuning-demo-trigger a:focus-visible,
body[data-demo-state] .tuning-demo-trigger button:focus-visible {
  outline-color: #fff;
}

body[data-demo-state="before"] .topbar {
  background: #5d6d77;
}

body[data-demo-state="before"] .site-header {
  position: static;
  background: #fffdf7;
  box-shadow: none;
}

body[data-demo-state="before"] .header-inner {
  min-height: 76px;
}

body[data-demo-state="before"] .brand-mark {
  border-radius: 4px;
  background: #607383;
}

body[data-demo-state="before"] .brand-mark::after {
  background: #c7a35c;
}

body[data-demo-state="before"] .main-nav a {
  color: #59636b;
  font-weight: 600;
}

body[data-demo-state="before"] .header-cta {
  background: transparent;
  border: 1px solid #b9b0a3;
  color: #4d565c;
  border-radius: 4px;
  font-weight: 700;
}

body[data-demo-state="before"] .hero {
  min-height: auto;
  color: #26313a;
  background:
    linear-gradient(90deg, rgba(248,245,237,.66) 0%, rgba(248,245,237,.45) 44%, rgba(248,245,237,.08) 100%),
    url("./images/pagivo-demo-untuned/hero-malermeister-kramer.jpg") right center / cover no-repeat,
    #efe8dc;
  border-bottom: 1px solid var(--demo-before-line);
}

body[data-demo-state="before"] .hero::before,
body[data-demo-state="before"] .hero::after {
  display: none;
}

body[data-demo-state="before"] .hero-shell {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 2rem;
  padding: clamp(2.6rem, 6vw, 4.3rem) 0;
}

body[data-demo-state="before"] .badge-row {
  gap: .4rem;
}

body[data-demo-state="before"] .badge {
  background: #ede7db;
  border: 1px solid #d6cec0;
  color: #59616a;
  box-shadow: none;
}

body[data-demo-state="before"] .hero-content h1 {
  color: #35434d;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  letter-spacing: -.035em;
  max-width: 11ch;
}

body[data-demo-state="before"] .hero-lead {
  color: #4f5961;
  max-width: 58ch;
}

body[data-demo-state="before"] .btn-row {
  align-items: flex-start;
}

body[data-demo-state="before"] .btn-primary {
  background: #8b7d66;
  color: #fffdf7;
  border-radius: 4px;
  min-height: 44px;
  padding-inline: 1rem;
  box-shadow: none;
}

body[data-demo-state="before"] .btn-outline {
  background: transparent;
  border: 1px solid #bbb1a2;
  color: #5b646b;
  border-radius: 4px;
  min-height: 44px;
}

body[data-demo-state="before"] .hero-card,
body[data-demo-state="before"] .card,
body[data-demo-state="before"] .review,
body[data-demo-state="before"] .process,
body[data-demo-state="before"] .contact-card {
  border-radius: 6px;
  border-color: #d6cec0;
  box-shadow: none;
}

body[data-demo-state="before"] .hero-card {
  background: #fffdf7;
  transform: rotate(.15deg);
}

.hero-visual-card {
  display: none;
}

body[data-demo-state="before"] .facts {
  background: #fffdf7;
}

body[data-demo-state="before"] section {
  padding-block: clamp(3.1rem, 6vw, 4.6rem);
}

body[data-demo-state="before"] .section-head {
  align-items: start;
}

body[data-demo-state="before"] .eyebrow {
  color: #887348;
}

body[data-demo-state="before"] .section-text {
  color: #687078;
}

body[data-demo-state="before"] .media {
  min-height: 150px;
  background-size: cover;
  background-position: center;
  filter: saturate(.96) contrast(.98);
}

body[data-demo-state="before"] .media::before,
body[data-demo-state="before"] .media::after {
  display: none;
}

body[data-demo-state="before"] #leistungen .media.interior { background-image: url("./images/pagivo-demo-untuned/leistungen-malerarbeiten.jpg"); }
body[data-demo-state="before"] #leistungen .media.facade { background-image: url("./images/pagivo-demo-untuned/leistungen-fassade.jpg"); }
body[data-demo-state="before"] #leistungen .media.reno { background-image: url("./images/pagivo-demo-untuned/leistungen-renovierung.jpg"); }
body[data-demo-state="before"] #referenzen .media.interior { background-image: url("./images/pagivo-demo-untuned/beispiel-wohnraum.jpg"); }
body[data-demo-state="before"] #referenzen .media.facade { background-image: url("./images/pagivo-demo-untuned/beispiel-gewerbe.jpg"); }
body[data-demo-state="before"] #referenzen .media.reno { background-image: url("./images/pagivo-demo-untuned/beispiel-fassade.jpg"); }

body[data-demo-state="before"] .about-grid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 780px;
}

body[data-demo-state="before"] .about-photo {
  display: none;
}

body[data-demo-state="before"] .about-photo::before,
body[data-demo-state="before"] .about-photo::after {
  display: none;
}

body[data-demo-state="before"] .reviews {
  background:
    linear-gradient(180deg, rgba(70,80,88,.48), rgba(70,80,88,.54)),
    url("./images/pagivo-demo-untuned/hinweise-allgemein.jpg") center / cover no-repeat;
}

body[data-demo-state="before"] .contact {
  background:
    linear-gradient(90deg, rgba(244,247,249,.78), rgba(244,247,249,.48)),
    url("./images/pagivo-demo-untuned/kontakt-standard.jpg") left bottom / min(520px, 46vw) auto no-repeat,
    #f4f7f9;
}

body[data-demo-state="before"] .visual-form .btn-primary {
  width: auto;
  align-self: start;
}

body[data-demo-state="after"] .badge-row {
  display: none;
}

/* Demo control area. */
.tuning-demo-trigger {
  position: relative;
  overflow: hidden;
  padding: clamp(2.2rem, 5vw, 3.6rem) 0;
  background: #111827;
  color: #fff;
}

.tuning-demo-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: .9rem;
  justify-items: center;
  text-align: center;
}

.tuning-demo-status {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.86);
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .02em;
  margin: 0;
  padding: .45rem .85rem;
}

.tuning-demo-instruction {
  max-width: 720px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.tuning-demo-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-top: .3rem;
}

.pagivo-tuning-button,
.tuning-replay-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.pagivo-tuning-button {
  min-height: 62px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffba4a, #f18619);
  color: #18130a;
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  font-weight: 950;
  padding: 1rem 1.55rem;
  box-shadow: 0 22px 54px rgba(241,134,25,.35);
}

.pagivo-tuning-button:focus-visible,
.tuning-replay-button:focus-visible,
.tuning-primary-cta:focus-visible,
.tuning-back-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.tuning-primary-cta {
  min-height: 58px;
  border-radius: 999px;
  padding-inline: 1.6rem;
  background: linear-gradient(135deg, #ffba4a, #f18619);
  color: #18130a;
  font-weight: 950;
  box-shadow: 0 24px 58px rgba(241,134,25,.25);
}

.tuning-replay-button {
  min-height: 42px;
  align-self: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.84);
  font-size: .9rem;
  font-weight: 800;
  padding: .65rem .95rem;
}

.tuning-results {
  width: min(1120px, 100%);
  margin-top: .55rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 28px;
  background: rgba(255,255,255,.11);
  box-shadow: 0 30px 82px rgba(0,0,0,.26);
  padding: clamp(1.15rem, 2.8vw, 1.8rem);
  text-align: left;
  backdrop-filter: blur(18px);
}

.tuning-results h2 {
  max-width: 760px;
  margin: 0 0 1rem;
  color: #fff;
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.tuning-result-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.75rem, 1.6vw, 1rem);
}

.tuning-result-list div {
  display: grid;
  gap: .6rem;
  align-content: start;
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  color: #27323a;
  padding: clamp(1rem, 1.8vw, 1.15rem);
  min-height: 184px;
  box-shadow: 0 16px 42px rgba(4,15,28,.16);
}

.tuning-result-list strong {
  color: #071426;
  font-size: clamp(1.05rem, 1.4vw, 1.18rem);
}

.tuning-result-list p {
  margin: 0;
  color: #4e5d69;
  font-size: .95rem;
  line-height: 1.42;
}

.tuning-result-list p span {
  display: block;
  margin-bottom: .18rem;
  color: #8a5b12;
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tuning-result-list .result-after {
  color: #153549;
  font-weight: 800;
}

.tuning-result-list > div > span {
  color: #0a6847;
  font-weight: 950;
  text-align: center;
}

.tuning-demo-return {
  margin-top: .25rem;
}

.tuning-back-link {
  color: rgba(255,255,255,.76);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.26);
}

.pagivo-tuning-wave {
  position: fixed;
  left: var(--tuning-origin-x, 50%);
  top: var(--tuning-origin-y, 50%);
  z-index: 999;
  width: 24px;
  height: 24px;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255,255,255,.9) 0 9%, rgba(255,186,74,.92) 10% 24%, rgba(0,122,255,.76) 25% 45%, rgba(7,20,38,.94) 46% 100%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

body.is-transforming .pagivo-tuning-wave {
  animation: pagivoTuneWave 1200ms cubic-bezier(.2, .88, .22, 1) both;
}

body.is-transforming main > section:not(.tuning-demo-trigger) {
  animation: pagivoContentLift 720ms ease both;
}

/* AFTER: stronger hierarchy, visible imagery, clearer trust and conversion path. */
body[data-demo-state="after"] {
  background: #fbfaf6;
  color: var(--demo-after-ink);
}

body[data-demo-state="after"] .demo-note {
  background: #24313a;
}

body[data-demo-state="after"] .topbar {
  background: #183747;
}

body[data-demo-state="after"] .site-header {
  position: sticky;
  scroll-margin-top: 92px;
  background: rgba(255,255,255,.92);
  border-bottom-color: rgba(8,31,59,.08);
  box-shadow: 0 10px 28px rgba(8,31,59,.08);
}

body[data-demo-state="after"] .header-inner {
  min-height: 72px;
}

body[data-demo-state="after"] .brand-mark {
  border-radius: 16px;
  background: linear-gradient(145deg, #174b5f, #2f6f81);
  box-shadow: 0 10px 22px rgba(8,31,59,.13);
}

body[data-demo-state="after"] .header-cta {
  border-radius: 999px;
  background: #e79a2f;
  color: #1c1408;
  box-shadow: 0 10px 24px rgba(176,105,21,.18);
}

body[data-demo-state="after"] .hero {
  min-height: min(650px, calc(100vh - 18px));
  color: #fff;
  background:
    linear-gradient(135deg, #173443 0%, #244f5c 54%, #3b4a3f 100%);
}

body[data-demo-state="after"] .hero::before {
  display: block;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0));
  opacity: 1;
}

body[data-demo-state="after"] .hero::after {
  display: none;
}

body[data-demo-state="after"] .hero-shell {
  z-index: 2;
  min-height: inherit;
  grid-template-columns: minmax(0, .82fr) minmax(390px, 590px);
  grid-template-areas:
    "copy visual"
    "copy card";
  gap: clamp(.85rem, 2.2vw, 1.45rem) clamp(1.8rem, 4vw, 3.4rem);
  align-items: center;
  padding-block: clamp(2.4rem, 5vw, 3.7rem);
}

body[data-demo-state="after"] .hero-content {
  grid-area: copy;
}

body[data-demo-state="after"] .hero-visual-card {
  grid-area: visual;
  display: block;
  min-height: clamp(310px, 35vw, 445px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 62%, rgba(27,38,34,.24) 100%),
    url("./images/pagivo-demo-tuning/webp/01_hero-right-visual_premium-renovierung.webp") center / cover no-repeat;
  box-shadow: 0 16px 38px rgba(0,0,0,.18);
  overflow: hidden;
  position: relative;
}

body[data-demo-state="after"] .hero-visual-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: inherit;
  pointer-events: none;
}

body[data-demo-state="after"] .hero-visual-card span {
  position: absolute;
  left: 16px;
  bottom: 16px;
  border-radius: 10px;
  background: rgba(255,255,255,.92);
  color: #123247;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .02em;
  padding: .38rem .64rem;
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

body[data-demo-state="after"] h1 {
  max-width: 16ch;
  color: #fff;
  margin-bottom: .7rem;
  text-shadow: 0 10px 30px rgba(0,0,0,.22);
}

body[data-demo-state="after"] .hero-lead {
  color: rgba(255,255,255,.84);
  margin-bottom: 1.15rem;
  text-shadow: 0 10px 30px rgba(0,0,0,.22);
}

body[data-demo-state="after"] .badge {
  border-color: rgba(255,255,255,.24);
  background: rgba(255,255,255,.11);
  color: rgba(255,255,255,.9);
  box-shadow: 0 16px 44px rgba(0,0,0,.16);
  backdrop-filter: blur(14px);
}

body[data-demo-state="after"] .hero .btn-primary {
  min-height: 58px;
  border-radius: 999px;
  background: #e79a2f;
  color: #18130a;
  box-shadow: 0 12px 28px rgba(176,105,21,.24);
}

body[data-demo-state="after"] .hero .btn-outline {
  min-height: 56px;
  border-radius: 999px;
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.06);
  color: #fff;
}

.tuning-benefit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .8rem;
}

.tuning-benefit-chips span {
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.92);
  font-size: .78rem;
  font-weight: 850;
  padding: .4rem .64rem;
  backdrop-filter: none;
}

body[data-demo-state="after"] .hero-card {
  grid-area: card;
  align-self: start;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.64);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,.13);
  color: var(--demo-after-ink);
  padding: .95rem;
}

body[data-demo-state="after"] .hero-card h2 {
  color: #173443;
  font-size: 1.05rem;
  margin-bottom: .55rem;
}

body[data-demo-state="after"] .hero-card .quick-list {
  gap: .38rem;
  margin-bottom: .6rem;
}

body[data-demo-state="after"] .hero-card .quick-list li {
  color: #34424a;
}

body[data-demo-state="after"] .hero-card .quick-list li::before {
  background: #f3d7a8;
  color: #221407;
}

body[data-demo-state="after"] .hero-card-note {
  margin: .25rem 0 0;
  color: #65717a;
  font-size: .84rem;
  line-height: 1.4;
}

body[data-demo-state="after"] .facts {
  border-bottom: 0;
  background: linear-gradient(180deg, #fff, #f7f3ea);
}

body[data-demo-state="after"] .facts-grid {
  position: relative;
  z-index: 3;
  margin-top: -2.2rem;
  border: 1px solid rgba(8,31,59,.08);
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 18px 46px rgba(8,31,59,.1);
  overflow: hidden;
}

body[data-demo-state="after"] .fact strong {
  color: #174b5f;
  font-size: 1.2rem;
}

body[data-demo-state="after"] section {
  padding-block: clamp(3.2rem, 5.8vw, 4.8rem);
}

body[data-demo-state="after"] section[id] {
  scroll-margin-top: 96px;
}

body[data-demo-state="after"] .section-head {
  align-items: end;
}

body[data-demo-state="after"] .eyebrow {
  color: #d77f13;
}

body[data-demo-state="after"] .card,
body[data-demo-state="after"] .process,
body[data-demo-state="after"] .contact-card {
  border-color: rgba(8,31,59,.08);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(8,31,59,.07);
}

body[data-demo-state="after"] .media {
  min-height: 210px;
  background-size: cover;
  background-position: center;
}

body[data-demo-state="after"] .media::before,
body[data-demo-state="after"] .media::after {
  display: none;
}

body[data-demo-state="after"] #leistungen .media.interior { background-image: url("./images/pagivo-demo-tuning/webp/03_service-card_innenanstriche.webp"); }
body[data-demo-state="after"] #leistungen .media.facade { background-image: url("./images/pagivo-demo-tuning/webp/04_service-card_fassadenarbeiten.webp"); }
body[data-demo-state="after"] #leistungen .media.reno { background-image: url("./images/pagivo-demo-tuning/webp/05_service-card_renovierung.webp"); }
body[data-demo-state="after"] #referenzen .media.interior { background-image: url("./images/pagivo-demo-tuning/webp/06_reference-card_wohnraum-vorher-nachher.webp"); }
body[data-demo-state="after"] #referenzen .media.facade { background-image: url("./images/pagivo-demo-tuning/webp/07_reference-card_gewerbe-praxisraeume.webp"); }
body[data-demo-state="after"] #referenzen .media.reno { background-image: url("./images/pagivo-demo-tuning/webp/08_reference-card_fassade-einfamilienhaus.webp"); }

body[data-demo-state="after"] .cream {
  background: linear-gradient(90deg, rgba(250,247,241,.96), rgba(255,255,255,.98));
}

body[data-demo-state="after"] .about-photo {
  min-height: 400px;
  border: 0;
  border-radius: 26px;
  background: url("./images/pagivo-demo-tuning/webp/02_about-illustration_betrieb-baustelle.webp") center / cover no-repeat;
  box-shadow: 0 14px 38px rgba(8,31,59,.1);
}

body[data-demo-state="after"] .about-photo::before,
body[data-demo-state="after"] .about-photo::after {
  display: none;
}

body[data-demo-state="after"] .check {
  border-color: rgba(8,31,59,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 34px rgba(8,31,59,.06);
}

body[data-demo-state="after"] .reviews {
  background:
    linear-gradient(180deg, rgba(250,247,241,.94), rgba(246,241,232,.96)),
    url("./images/pagivo-demo-tuning/vertrauen-material-werkzeug.jpg") center / cover no-repeat;
  color: var(--demo-after-ink);
}

body[data-demo-state="after"] .review {
  border-color: rgba(8,31,59,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 28px rgba(8,31,59,.08);
}

body[data-demo-state="after"] .reviews h2 {
  color: #173443;
}

body[data-demo-state="after"] .reviews .section-text,
body[data-demo-state="after"] .review p {
  color: #5f6c73;
}

body[data-demo-state="after"] .review strong {
  color: #173443;
}

body[data-demo-state="after"] .stars {
  color: #b46d13;
}

body[data-demo-state="after"] .process::before {
  border-radius: 14px;
  background: #e8f6ff;
  color: #174b5f;
}

body[data-demo-state="after"] .tuning-demo-trigger {
  padding: clamp(2.2rem, 4.6vw, 3.8rem) 0 clamp(1.8rem, 3.8vw, 3rem);
  background: linear-gradient(180deg, #263a45, #1c2d35);
}

body[data-demo-state="after"] .tuning-demo-status,
body[data-demo-state="after"] .tuning-demo-instruction {
  display: none;
}

body[data-demo-state="after"] .tuning-demo-controls {
  margin-top: .35rem;
}

body[data-demo-state="after"] .tuning-primary-cta {
  min-height: 56px;
}

body[data-demo-state="after"] .tuning-replay-button {
  min-height: 38px;
  padding: .55rem .8rem;
}

body[data-demo-state="after"] .contact {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 10%, rgba(255,186,74,.18), transparent 28%),
    linear-gradient(135deg, #f4faff 0%, #ffffff 54%, #eef8ff 100%);
}

body[data-demo-state="after"] .contact-card:not(.visual-form)::after {
  content: "Region Cuxhaven · Vor-Ort-Termine nach Absprache";
  display: block;
  margin-top: .9rem;
  min-height: 96px;
  border: 1px solid rgba(8,31,59,.08);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(7,59,99,.12) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(7,59,99,.1) 1px, transparent 1px) 0 0 / 34px 34px,
    radial-gradient(circle at 54% 46%, #ffba4a 0 8px, transparent 9px),
    linear-gradient(135deg, #eef8ff, #ffffff);
  color: #174b5f;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .01em;
  padding: 1rem;
}

body[data-demo-state="after"] .visual-form {
  background: rgba(255,255,255,.9);
}

body[data-demo-state="after"] .visual-form .btn-primary {
  min-height: 58px;
  border-radius: 999px;
  background: #e79a2f;
  color: #18130a;
}

@keyframes pagivoTuneWave {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(0); }
  58% { opacity: .95; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(180); }
}

@keyframes pagivoContentLift {
  0% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
  100% { transform: translateY(0); }
}

@media (hover: hover) and (pointer: fine) {
  body[data-demo-state="after"] .card,
  body[data-demo-state="after"] .process,
  body[data-demo-state="after"] .review,
  body[data-demo-state="after"] .contact-card {
    transition: transform 240ms ease, box-shadow 240ms ease;
  }

  body[data-demo-state="after"] .card:hover,
  body[data-demo-state="after"] .process:hover,
  body[data-demo-state="after"] .review:hover,
  body[data-demo-state="after"] .contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 46px rgba(8,31,59,.12);
  }
}

@media (max-width: 980px) {
  body[data-demo-state="before"] .hero-shell {
    grid-template-columns: 1fr;
  }

  body[data-demo-state="after"] .hero {
    min-height: 0;
  }

  body[data-demo-state="after"] .hero-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "visual"
      "card";
    gap: .65rem;
    padding-block: 1.25rem 1.55rem;
  }

  body[data-demo-state="after"] h1 {
    max-width: 15ch;
  }

  body[data-demo-state="after"] .hero-visual-card {
    min-height: clamp(185px, 46vw, 300px);
  }

  body[data-demo-state="after"] .facts-grid {
    margin-top: 0;
  }

  body[data-demo-state="after"] section[id] {
    scroll-margin-top: 116px;
  }

  .tuning-result-list {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 720px) {
  .tuning-result-list {
    grid-template-columns: 1fr;
  }

  .tuning-result-list div {
    min-height: 0;
  }

  .tuning-result-list span {
    text-align: left;
  }
}

@media (max-width: 640px) {
  body[data-demo-state="before"] .topbar .shell {
    min-height: 34px;
    gap: .1rem;
    padding: .35rem 0;
  }

  body[data-demo-state="before"] .header-inner {
    grid-template-columns: 1fr auto;
    min-height: 58px;
    gap: .65rem;
    padding: .45rem 0;
  }

  body[data-demo-state="before"] .brand-mark {
    width: 40px;
    height: 40px;
  }

  body[data-demo-state="before"] .brand-copy strong {
    font-size: .95rem;
  }

  body[data-demo-state="before"] .brand-copy span,
  body[data-demo-state="before"] .main-nav {
    display: none;
  }

  body[data-demo-state="before"] .header-cta {
    width: auto;
    min-height: 38px;
    padding: .46rem .68rem;
    font-size: .82rem;
  }

  body[data-demo-state="before"] .hero {
    background:
      linear-gradient(180deg, rgba(248,245,237,.84) 0%, rgba(248,245,237,.64) 54%, rgba(248,245,237,.18) 100%),
      url("./images/pagivo-demo-untuned/hero-malermeister-kramer.jpg") center bottom / cover no-repeat,
      #efe8dc;
  }

  body[data-demo-state="before"] .hero-shell {
    gap: 1rem;
    padding: 1.9rem 0 2.1rem;
  }

  body[data-demo-state="before"] .hero-content h1 {
    font-size: clamp(1.9rem, 8vw, 2.35rem);
    margin-bottom: .7rem;
  }

  body[data-demo-state="before"] .hero-lead {
    font-size: .98rem;
    margin-bottom: 1rem;
  }

  body[data-demo-state="before"] .hero-card {
    padding: .95rem;
  }

  body[data-demo-state="before"] .media {
    min-height: 145px;
  }

  body[data-demo-state="after"] .demo-note {
    font-size: .72rem;
    padding: .28rem .75rem;
  }

  body[data-demo-state="after"] .topbar {
    font-size: .76rem;
  }

  body[data-demo-state="after"] .topbar .shell {
    min-height: 30px;
    padding: .28rem 0;
    gap: 0;
  }

  body[data-demo-state="after"] .topbar span:first-child {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-demo-state="after"] .topbar span:last-child {
    display: none;
  }

  body[data-demo-state="after"] .header-inner {
    grid-template-columns: 1fr auto;
    min-height: 58px;
    gap: .65rem;
    padding: .45rem 0;
  }

  body[data-demo-state="after"] .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.1rem;
  }

  body[data-demo-state="after"] .brand-copy strong {
    font-size: .95rem;
  }

  body[data-demo-state="after"] .brand-copy span,
  body[data-demo-state="after"] .main-nav {
    display: none;
  }

  body[data-demo-state="after"] .header-cta {
    width: auto;
    min-height: 38px;
    border-radius: 999px;
    padding: .5rem .72rem;
    font-size: .82rem;
  }

  body[data-demo-state="after"] .hero-shell {
    padding: .95rem 0 1.15rem;
  }

  body[data-demo-state="before"] .hero-content h1,
  body[data-demo-state="after"] h1 {
    max-width: 100%;
  }

  body[data-demo-state="after"] h1 {
    font-size: clamp(1.9rem, 8.5vw, 2.38rem);
    margin-bottom: .48rem;
  }

  body[data-demo-state="after"] .hero-lead {
    font-size: .96rem;
    line-height: 1.42;
    margin-bottom: .72rem;
  }

  body[data-demo-state="after"] .btn-row {
    gap: .5rem;
  }

  body[data-demo-state="after"] .hero .btn-primary,
  body[data-demo-state="after"] .hero .btn-outline {
    min-height: 46px;
  }

  body[data-demo-state="after"] .tuning-benefit-chips {
    gap: .35rem;
    margin-top: .65rem;
  }

  body[data-demo-state="after"] .tuning-benefit-chips span {
    font-size: .72rem;
    padding: .32rem .5rem;
  }

  body[data-demo-state="after"] .hero-visual-card {
    min-height: 230px;
    border-radius: 18px;
  }

  body[data-demo-state="after"] .hero-visual-card::before {
    inset: 10px;
    border-radius: 15px;
  }

  body[data-demo-state="after"] .hero-visual-card span {
    left: 12px;
    bottom: 12px;
    font-size: .68rem;
    padding: .3rem .5rem;
  }

  body[data-demo-state="after"] .hero-card {
    margin-top: .1rem;
    padding: .75rem;
    border-radius: 18px;
  }

  body[data-demo-state="after"] .hero-card h2 {
    font-size: .98rem;
    margin-bottom: .35rem;
  }

  body[data-demo-state="after"] .hero-card .quick-list {
    gap: .26rem;
    margin-bottom: .4rem;
  }

  body[data-demo-state="after"] .hero-card .quick-list li {
    gap: .4rem;
    font-size: .88rem;
  }

  body[data-demo-state="after"] .hero-card .quick-list li::before {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    font-size: .72rem;
  }

  body[data-demo-state="after"] .hero-card-note {
    font-size: .78rem;
  }

  body[data-demo-state="after"] .tuning-demo-trigger {
    padding: 1.35rem 0 1.45rem;
  }

  body[data-demo-state="after"] .tuning-results {
    border-radius: 20px;
    padding: 1rem;
  }

  body[data-demo-state="after"] .tuning-results h2 {
    font-size: clamp(1.42rem, 7vw, 1.72rem);
    margin-bottom: .85rem;
  }

  body[data-demo-state="after"] .tuning-result-list {
    gap: .75rem;
  }

  body[data-demo-state="after"] .tuning-result-list div {
    padding: .95rem;
  }

  body[data-demo-state="after"] .tuning-demo-panel {
    gap: .85rem;
  }

  .tuning-demo-controls,
  .tuning-primary-cta,
  .pagivo-tuning-button,
  .tuning-replay-button {
    width: 100%;
  }

  body[data-demo-state="after"] section {
    padding-block: 2.6rem;
  }

  body[data-demo-state="after"] .section-head {
    gap: .75rem;
    margin-bottom: 1.1rem;
  }

  body[data-demo-state="after"] .media {
    min-height: 175px;
  }

  body[data-demo-state="after"] .about-photo {
    min-height: 240px;
  }

  body[data-demo-state="after"] .field.big {
    min-height: 92px;
  }

  body[data-demo-state="after"] .contact-card:not(.visual-form)::after {
    min-height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  body.is-transforming .pagivo-tuning-wave {
    animation: none;
  }
}

/* Mobile-first hardening for the live demo page at smartphone widths. */
@media (max-width: 640px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body[data-demo-state] {
    font-size: 16px;
    line-height: 1.55;
  }

  body[data-demo-state] .shell {
    width: min(100% - 28px, 1180px);
  }

  body[data-demo-state] .site-header {
    top: 0;
  }

  body[data-demo-state] .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  body[data-demo-state] .brand,
  body[data-demo-state] .brand-copy {
    min-width: 0;
  }

  body[data-demo-state] .brand-copy strong {
    max-width: 44vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-demo-state] .main-nav {
    display: none;
  }

  body[data-demo-state] .header-cta {
    width: auto;
    min-height: 44px;
    padding: .58rem .78rem;
    line-height: 1.1;
  }

  body[data-demo-state="before"] .hero {
    background:
      linear-gradient(180deg, rgba(248,245,237,.72) 0%, rgba(248,245,237,.58) 58%, rgba(248,245,237,.28) 100%),
      url("./images/pagivo-demo-untuned/hero-malermeister-kramer.jpg") center top / cover no-repeat,
      #efe8dc;
  }

  body[data-demo-state="before"] .hero-content h1 {
    max-width: 12ch;
  }

  body[data-demo-state] .hero-shell,
  body[data-demo-state="after"] .hero-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "visual"
      "card";
    gap: 1rem;
  }

  body[data-demo-state] h1,
  body[data-demo-state="after"] h1 {
    font-size: clamp(2.05rem, 9vw, 2.55rem);
    line-height: 1.06;
    letter-spacing: -.035em;
  }

  body[data-demo-state] h2,
  body[data-demo-state="after"] h2 {
    font-size: clamp(1.72rem, 7vw, 2.1rem);
    line-height: 1.12;
  }

  body[data-demo-state] h3 {
    font-size: 1.12rem;
  }

  body[data-demo-state] .hero-lead,
  body[data-demo-state="after"] .hero-lead,
  body[data-demo-state] .section-text,
  body[data-demo-state] .card p,
  body[data-demo-state] .review p,
  body[data-demo-state] .process p,
  body[data-demo-state] .contact-card,
  body[data-demo-state] .field {
    font-size: 1rem;
  }

  body[data-demo-state] .btn,
  body[data-demo-state] button,
  body[data-demo-state] .field {
    min-height: 44px;
  }

  body[data-demo-state] .btn-row {
    gap: .7rem;
  }

  body[data-demo-state] .hero .btn-primary,
  body[data-demo-state] .hero .btn-outline,
  body[data-demo-state="after"] .hero .btn-primary,
  body[data-demo-state="after"] .hero .btn-outline {
    min-height: 50px;
  }

  body[data-demo-state] .section-head,
  body[data-demo-state] .grid-3,
  body[data-demo-state] .grid-4,
  body[data-demo-state] .check-grid,
  body[data-demo-state] .contact-grid,
  body[data-demo-state] .facts-grid,
  body[data-demo-state="after"] .section-head,
  body[data-demo-state="after"] .grid-3,
  body[data-demo-state="after"] .grid-4,
  body[data-demo-state="after"] .check-grid,
  body[data-demo-state="after"] .contact-grid,
  body[data-demo-state="after"] .facts-grid {
    grid-template-columns: 1fr;
  }

  body[data-demo-state] .card-body,
  body[data-demo-state] .review,
  body[data-demo-state] .process,
  body[data-demo-state] .contact-card {
    padding: 1rem;
  }

  body[data-demo-state="after"] section[id] {
    scroll-margin-top: 78px;
  }

  body[data-demo-state="after"] .hero-visual-card {
    min-height: 210px;
  }

  body[data-demo-state="after"] .hero-card {
    padding: 1rem;
  }

  body[data-demo-state="after"] .hero-card h2 {
    font-size: 1.12rem;
  }

  body[data-demo-state="after"] .hero-card .quick-list li,
  body[data-demo-state="after"] .hero-card-note {
    font-size: 1rem;
  }

  body[data-demo-state="after"] .tuning-results {
    padding: 1rem;
  }

  body[data-demo-state="after"] .tuning-results h2 {
    font-size: 1.42rem;
    line-height: 1.18;
  }

  body[data-demo-state="after"] .tuning-result-list {
    grid-template-columns: 1fr;
    gap: .75rem;
  }

  body[data-demo-state="after"] .tuning-result-list div {
    min-height: 0;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.45;
  }

  body[data-demo-state="after"] .tuning-result-list strong {
    font-size: 1.04rem;
  }

  body[data-demo-state="after"] .tuning-result-list p {
    font-size: 1rem;
    line-height: 1.45;
  }
}
