/* MD Electrics — a continuous, scroll-controlled home tour. */
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid #9a4b11; outline-offset: 6px; }
#md-tour { --service: #aa4d11; --progress: 0; height: 700svh; position: relative; z-index: 1; }
.tour-sticky { position: sticky; top: 0; height: 100svh; min-height: 640px; overflow: hidden; background: #f6efe8; isolation: isolate; }
.tour-masthead { position: absolute; top: 32px; left: 4%; right: 4%; z-index: 3; display: flex; align-items: center; gap: 38px; }
.tour-wordmark { font-family: Anton,sans-serif; font-size: 30px; line-height: 1; letter-spacing: -.025em; }
.tour-wordmark > span { color: #e86c12; }
.tour-wordmark small { display: block; font-family: 'Hanken Grotesk',sans-serif; font-size: 9px; letter-spacing: .44em; margin-top: 8px; }
.tour-masthead p { font-size: 11px; line-height: 1.7; color: #514d44; margin: 0; }
.tour-masthead p span { color: #797167; }
.tour-value { display: none; }
.tour-contact { margin-left: auto; border: 1px solid #d5b49a; background: #ed7d2f; color: #24180f; border-radius: 3px; padding: 11px 14px; min-width: 168px; font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; gap: 14px; transition: transform .2s, filter .2s; }
.tour-contact:hover { color: #24180f; filter: brightness(1.06); transform: translateY(-1px); }
.tour-world { position: absolute; inset: 0; z-index: 0; }
.tour-world canvas { display: block; width: 100%; height: 100%; }
.tour-breaker-controls { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.tour-breaker-controls[hidden], .tour-breaker-button[hidden], .tour-unavailable .tour-breaker-controls { display: none; }
.tour-breaker-button { position: absolute; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; pointer-events: auto; cursor: pointer; touch-action: manipulation; }
.tour-breaker-button:hover { background: rgba(242,145,53,.12); border-color: rgba(173,92,23,.7); }
.tour-breaker-button:focus-visible { outline: 2px solid #a4520f; outline-offset: 2px; }
.tour-circuit-status { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tour-blackout { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; overflow: hidden; overscroll-behavior: none; touch-action: none; }
.tour-blackout::backdrop { background: #000; }
.tour-restore-power { position: absolute; left: clamp(36px,var(--switch-x,50vw),calc(100vw - 36px)); top: clamp(44px,var(--switch-y,50dvh),calc(100dvh - 44px)); transform: translate(-50%,-50%); display: grid; place-items: center; padding: 0; border: 2px solid #8f2d20; border-radius: 5px; background: linear-gradient(#9b3020 0%,#d04d35 42%,#de6045 94%,#a03222 95%); box-shadow: inset 2px 0 1px #ff8c6655,inset -2px 0 1px #66160f88; color: #fff; font: 700 9px/1.2 'Hanken Grotesk',sans-serif; cursor: pointer; touch-action: manipulation; }
.tour-restore-power:focus-visible { outline: 2px solid #e88b68; outline-offset: 4px; }
.tour-restore-power:active { background: #be412d; }
/* Scrims: the camera passes through dark brick, so the copy column and masthead need a
   ground of their own rather than relying on whatever the camera happens to be facing. */
.tour-world::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 34%; z-index: 1; background: linear-gradient(90deg,#f6efe8 0%,rgba(246,239,232,.97) 44%,rgba(246,239,232,.72) 68%,rgba(246,239,232,0) 100%); pointer-events: none; }
.tour-world::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 190px; z-index: 1; background: linear-gradient(180deg,rgba(246,239,232,.94) 0%,rgba(246,239,232,.74) 45%,rgba(246,239,232,0) 100%); pointer-events: none; }
.tour-copy { position: absolute; left: 4%; width: 36%; top: 50%; transform: translateY(-46%); z-index: 2; pointer-events: none; }
.tour-overline { font-size: 10px; text-transform: uppercase; letter-spacing: .19em; color: #797065; margin: 0 0 30px; }
.tour-chapters { display: grid; }
.tour-chapter { grid-area: 1/1; opacity: 0; visibility: hidden; transform: translateY(18px); transition: opacity .4s, transform .6s, visibility .4s; }
.tour-chapter.is-current { opacity: 1; visibility: visible; transform: translateY(0); }
.tour-kicker { font-size: 9px; display: flex; gap: 16px; color: #6b6359; margin: 0 0 16px; align-items: center; }
.tour-kicker > span { color: var(--service); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.tour-chapter h1,.tour-chapter h2 { font-family: Anton,sans-serif; font-weight: 400; font-size: clamp(40px,4.65vw,78px); letter-spacing: -.025em; line-height: 1.04; margin: 0; }
.tour-chapter em { font-style: normal; color: var(--service); }
.tour-description { font-size: 14px; line-height: 1.65; max-width: 31ch; margin: 25px 0 24px; color: #62594d; text-wrap: pretty; }
.tour-service { pointer-events: auto; display: inline-flex; justify-content: space-between; gap: 34px; padding: 14px 20px; background: #e87828; color: #24180f; font-size: 13px; font-weight: 700; border-radius: 3px; transition: background .2s,transform .2s; }
[data-chapter="1"] .tour-service { background: #a7c6a1; }
[data-chapter="2"] .tour-service { background: #b1d0e6; }
.tour-service:hover { transform: translateY(-2px); color: #24180f; filter: brightness(1.06); }
.tour-service:active { transform: translateY(0); }
.tour-details { color: #746b61; font-size: 10px; margin-top: 18px; }
.tour-scene-label { position: absolute; left: 66%; bottom: 144px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; font-size: 10px; color: #72695d; white-space: nowrap; letter-spacing: .04em; }
.tour-annotations { position:absolute; inset:0; pointer-events:none; z-index:4; }
.tour-annotation { position:absolute; left:50%; top:50%; z-index:5; will-change:left,top; display:flex; align-items:center; gap:7px; max-width:205px; padding:7px 10px; border:1px solid rgba(255,255,255,.58); border-radius:999px; background:rgba(24,29,31,.68); color:#fff; box-shadow:0 8px 22px rgba(22,20,17,.18); backdrop-filter:blur(9px); -webkit-backdrop-filter:blur(9px); font-size:10px; line-height:1.15; letter-spacing:.035em; opacity:0; transform:translate(-50%,-50%) translateY(-21px); transition:opacity .35s, transform .35s; white-space:nowrap; }
.tour-annotation i { width:6px; height:6px; flex:0 0 6px; border-radius:50%; background:#66b7ff; box-shadow:0 0 0 4px rgba(102,183,255,.18),0 0 12px rgba(102,183,255,.9); }
/* Lifted clear of the anchor so the pill floats above its hardware rather than
   covering it — the alarm box and doorbell are smaller than the label. */
.tour-annotation.is-visible { opacity:1; transform:translate(-50%,-50%) translateY(-26px); }
/* Dot carries the service colour: orange electrical, green eco, blue security (default). */
.annotation-board i,.annotation-lighting i,.annotation-sockets i,.annotation-cooker i,.annotation-outdoorlight i { background:#ff9a48; box-shadow:0 0 0 4px rgba(255,154,72,.18),0 0 12px rgba(255,154,72,.9); }
.annotation-battery i,.annotation-evcharger i,.annotation-aircon i,.annotation-panels i { background:#73db9c; box-shadow:0 0 0 4px rgba(115,219,156,.18),0 0 12px rgba(115,219,156,.9); }
/* left/top are written every frame by positionAnnotations() from each label's world-space
   anchor; these are only the pre-script defaults. */
.tour-live-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--service); box-shadow: 0 0 0 4px color-mix(in srgb,var(--service) 10%,transparent); }
.tour-bottom { display: none !important; }
.tour-scroll { display: flex; align-items: center; gap: 14px; font-size: 11px; min-width: 180px; }
.tour-scroll > span { font-size: 22px; }
.tour-scroll small { display: block; margin-top: 4px; color: #82776b; font-size: 10px; }
.tour-progress { display: flex; gap: 24px; flex: 1; max-width: 560px; margin: auto; }
.tour-progress button { --fill: 0; flex: 1; text-align: left; border: 0; padding: 6px 0 13px; position: relative; color: #81776c; font: 500 12px 'Hanken Grotesk',sans-serif; background: transparent; cursor: pointer; white-space: nowrap; }
.tour-progress button span { margin-right: 6px; font-size: 10px; opacity: .7; }
.tour-progress button i { position: absolute; height: 2px; bottom: 0; left: 0; right: 0; background: #ddd2c7; overflow: hidden; }
.tour-progress button i::after { content: ''; position: absolute; inset: 0; background: var(--service); transform: scaleX(var(--fill)); transform-origin: left; }
.tour-progress button.is-current { color: #302a23; }
.tour-progress button:hover { color: var(--service); }
.tour-skip { font-size: 10px; color: #746b61; }
.tour-motion { position: absolute; top: 121px; right: 4%; z-index: 3; border: 0; border-bottom: 1px solid #d8ccc0; padding: 7px 0; color: #786f64; background: transparent; font: 10px 'Hanken Grotesk',sans-serif; cursor: pointer; }
.tour-loading { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: #746b61; font-size: 12px; display: flex; align-items: center; gap: 10px; }
.tour-loading span { width: 7px; height: 7px; background: #e87828; border-radius: 50%; }
.tour-static { display: none; }
/* No WebGL (or it died): a normal document flow with a still of the house instead of an
   empty pinned stage, and the service cards stop floating over the page. */
.tour-unavailable { height: auto !important; }
.tour-unavailable .tour-sticky { position: relative; height: auto; min-height: 0; padding-top: 112px; }
.tour-unavailable .tour-world { position: relative; inset: auto; height: clamp(300px, 54vw, 640px); }
.tour-unavailable .tour-static { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; -webkit-mask-image: linear-gradient(#000 80%, transparent), linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(#000 80%, transparent), linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-composite: intersect; }
.tour-unavailable .tour-annotations, .tour-unavailable .tour-bottom, .tour-unavailable .tour-loading, .tour-unavailable .tour-scene-label { display: none !important; }
@media (min-width: 761px) {
  .tour-fallback .service-entrances { position: static; transform: none; width: auto; max-width: 1360px; margin: 0 auto; padding: 110px 5vw 0; grid-template-columns: repeat(3, 1fr); gap: 16px; box-sizing: border-box; }
  .tour-fallback .entrances-heading { grid-column: 1 / -1; }
  .tour-fallback .tour-sticky .service-entrances { padding-top: 0; }
  .tour-fallback .tour-unavailable .tour-sticky { padding-top: 112px; }
  .tour-fallback .tour-sticky .service-entrances { position: relative; z-index: 4; display: grid; }
  .tour-fallback #md-whatsapp-btn { bottom: 24px !important; }
}
.tour-unavailable .tour-motion,.tour-unavailable .tour-scene-label { display: none; }
.tour-nojs { padding: 90px 5vw; }
.tour-nojs a { display: inline-block; padding: 16px; }
#md-whatsapp-btn { width: 45px !important; height: 45px !important; right: 15px !important; bottom: 100px !important; }
@media (min-width: 1600px) { .tour-copy { width: 34%; } .tour-description { font-size: 16px; } }
@media (max-width: 1050px) { .tour-chapter h1,.tour-chapter h2 { font-size: 44px; } .tour-kicker { flex-direction: column; align-items: flex-start; gap: 5px; } .tour-progress { gap: 15px; } .tour-scroll { min-width: 145px; } .tour-skip { display: none; } }
@media (max-width: 760px) {
  .tour-sticky { min-height: 580px; }
  /* #md-mobile-topbar (fixed, 62px) already carries the logo and call button, so this
     row -- tagline plus the value-prop line -- is dropped rather than doubling up. */
  .tour-masthead { display: none; }
  .tour-copy { left: 22px; top: 145px; transform: none; width: calc(100% - 44px); }
  .tour-overline { display: none; }
  .tour-kicker { flex-direction: row; gap: 14px; font-size: 8px; margin-bottom: 10px; }
  .tour-chapter h1,.tour-chapter h2 { font-size: clamp(32px,7.5vw,48px); line-height: 1.03; }
  .tour-chapter h1 br:nth-child(2),.tour-chapter h2 br:nth-child(2) { display: none; }
  .tour-chapter h1 em::before,.tour-chapter h2 em::before { content: ' '; }
  .tour-description { font-size: 11px; max-width: 38ch; margin: 12px 0; line-height: 1.5; }
  .tour-service { padding: 10px 13px; font-size: 11px; }
  .tour-details { display: none; }
  .tour-world { inset: 310px -3% 115px; }
  .tour-world::after { display: none; }
  .tour-bottom { bottom: 82px; left: 22px; right: 22px; padding-top: 10px; }
  .tour-scroll { display: none; }
  .tour-progress { max-width: none; gap: 20px; }
  .tour-progress button { font-size: 11px; }
  .tour-scene-label { left: 50%; bottom: 145px; font-size: 9px; }
  .tour-motion { top: auto; bottom: 187px; right: 22px; font-size: 9px; }
  #md-whatsapp-btn { bottom: 84px !important; right: 10px !important; width: 38px !important; height: 38px !important; }
  #md-whatsapp-btn svg { width: 22px; height: 22px; }
  /* The fixed entrance-tile row doubles as the mobile bottom nav and never leaves the
     screen, so this footer copy of the same three links is a redundant nav sitting a
     few px above it once the visitor reaches the bottom of the page. */
  .md-footer-service-links { display: none !important; }
}
@media (max-width: 760px) and (max-height: 720px) {
 .tour-masthead { top: 71px; } .tour-copy { top: 120px; } .tour-description { max-width: 32ch; font-size: 10px; margin: 9px 0; } .tour-world { top: 274px; } .tour-chapter h1,.tour-chapter h2 { font-size: 31px; } .tour-motion { bottom: 133px; } .tour-scene-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
#md-tour.is-reduced .tour-chapter { transition: none; }
#md-content-wrap { margin-left: 0 !important; }

/* Always-visible entrances: the three doors into the sub-sites. Persistent, equal in
   weight, and obviously clickable. Service identity is carried by HUE ONLY — the three
   ink colours sit within 0.006 of each other in relative luminance, and so do the three
   button fills, so no branch can read as the main business or as a side line. */
.service-entrances { position: fixed; z-index: 42; left: 4%; top: 50%; transform: translateY(-44%); width: min(300px, 28vw); display: grid; gap: 10px; transition: opacity .35s ease, transform .35s ease, visibility .35s; }
/* The panel is pinned to the 3D stage; when the stage scrolls away it would otherwise sit
   on top of the footer, which carries the same three links. Mobile keeps it — there it is
   the bottom nav bar, on its own ground. */
@media (min-width: 761px) {
  :root.tour-exited .service-entrances { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-44%) translateX(-16px); }
}
.entrances-heading { padding: 0 0 10px; }
.entrances-heading h1 { font: 400 clamp(28px, 3vw, 43px)/1.05 Anton,sans-serif; letter-spacing: -.02em; margin: 0; }
.entrances-heading p { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: #5C5346; }

.service-entry { --entry-ink: #C8232B; --entry-fill: #E5484D; display: grid; gap: 6px; padding: 14px 16px 15px; border: 1px solid rgba(28,23,18,.10); border-radius: 6px; background: #FFFCF9; color: #292119; box-shadow: 0 1px 2px rgba(76,55,36,.05), 0 10px 24px rgba(76,55,36,.10); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; -webkit-tap-highlight-color: transparent; }
.entrance-solar { --entry-ink: #2C7A4E; --entry-fill: #5FBC7E; }
.entrance-security { --entry-ink: #4D535B; --entry-fill: #D6D6D6; }

.entrance-title { display: flex; align-items: center; gap: 9px; font: 400 clamp(19px,1.6vw,23px)/1.1 Anton,sans-serif; letter-spacing: -.01em; color: var(--entry-ink); }
/* Lights while that branch is the one on screen in the tour. Nothing else changes, so the
   three cards stay identical in weight at every scroll position. */
.entrance-title::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--entry-fill); opacity: 0; transition: opacity .35s ease; }
.service-entry.is-current .entrance-title::after { opacity: 1; }
.entrance-description { font-size: 11.5px; line-height: 1.45; color: #5C5346; }
.entrance-cred { font-size: 11px; line-height: 1.35; color: #6B6153; }
.entrance-cred b { color: var(--entry-ink); font-weight: 700; letter-spacing: .03em; }
.entrance-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; padding: 10px 12px; background: var(--entry-fill); border-radius: 4px; font-size: 11.5px; font-weight: 700; color: #1C1712; box-sizing: border-box; }

.service-entry:hover { transform: translateX(3px); border-color: rgba(28,23,18,.18); box-shadow: 0 1px 2px rgba(76,55,36,.06), 0 16px 34px rgba(76,55,36,.15); }
.service-entry:hover .entrance-action { filter: brightness(1.05); }
.service-entry:active { transform: translateX(1px); }
.service-entry:focus-visible { outline: 2px solid var(--entry-ink); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { .service-entry, .entrance-title::after { transition: none; } }
#contact { padding-left: 5vw !important; }
#contact .md-footer-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
@media (min-width: 761px) and (max-height: 760px) {
  .service-entrances { gap: 8px; }
  .entrances-heading h1 { font-size: 29px; }
  .entrances-heading p { margin-bottom: 8px; }
  .service-entry { padding: 10px 13px 11px; gap: 4px; }
  .entrance-title { font-size: 19px; }
  .entrance-cred { font-size: 10.5px; }
  .entrance-action { padding: 8px 11px; margin-top: 2px; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .service-entrances { left: 4%; width: 31vw; }
}
@media (max-width: 760px) {
  .service-entrances { inset: auto 0 calc(49px + env(safe-area-inset-bottom)) 0; transform: none; width: auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding: 10px 12px; background: rgba(246,239,232,.98); border-top: 1px solid #d9cfc2; box-shadow: 0 -6px 24px #30281c08; z-index: 65; }
  .entrances-heading, .entrance-description, .action-verb, .entrance-arrow { display: none; }
  /* Each cell is the button: the whole tile is filled in its service colour, so all three
     read as equally weighted, unmistakably tappable doors rather than a row of labels. */
  .service-entry { padding: 11px 7px 12px; gap: 4px; justify-items: center; text-align: center; align-content: center; min-height: 62px; background: var(--entry-fill); border: 0; border-radius: 6px; box-shadow: 0 1px 2px rgba(76,55,36,.10); color: #1C1712; }
  .entrance-title { font: 700 13px/1.2 'Hanken Grotesk',sans-serif; color: #1C1712; gap: 6px; }
  .entrance-title::after { width: 5px; height: 5px; background: #1C1712; }
  .entrance-cred { display: none; }
  .entrance-action { background: transparent; padding: 0; margin: 2px 0 0; font-size: 11px; gap: 4px; justify-content: center; }
  .service-entry:hover { transform: none; box-shadow: 0 1px 2px rgba(76,55,36,.10); }
  .service-entry:active { transform: translateY(1px); }
  /* The top-bar pill already carries this number; two identical CTAs 70px apart read as
     desperation and cost the space this bar needs. */
  .tour-contact { display: none; }
  /* Bottom inset used to reserve room for .tour-bottom's scroll hint/progress dots, but
     those are hidden on mobile now (the fixed entrance-tile row replaces them) -- the old
     205px just sat empty. As the sticky section releases at the end of the tour, that
     fixed-pixel band ate a growing share of the shrinking visible sliver, showing as a
     big blank gap between the model and the trust badges right before hand-off. */
  .tour-world { inset: 78px -3% 40px; }
  .tour-bottom { bottom: calc(151px + env(safe-area-inset-bottom)); }
  .tour-scene-label { bottom: calc(218px + env(safe-area-inset-bottom)); }
  .tour-motion { bottom: auto; top: 125px; right: 22px; }
  #md-whatsapp-btn { bottom: calc(162px + env(safe-area-inset-bottom)) !important; width: 44px !important; height: 44px !important; }
  #md-whatsapp-btn svg { width: 24px; height: 24px; }
  #contact { padding-left: 5vw !important; padding-bottom: 115px !important; }
  #md-content-wrap { padding-bottom: 155px !important; }
}
@media (max-width: 760px) and (max-height: 720px) {
  .tour-world { top: 116px; bottom: 196px; }
  .tour-motion { top: 113px; bottom: auto; }
}
