/*
 * Forside-hero v3 — three HiluX D8 stories, one per visit.
 *
 * All three variants are in the HTML; the inline picker in index.html sets
 * html[data-hero] before the section is parsed, so there is no flash and the
 * hidden variants' loading="lazy" images are never fetched. Behaviour lives in
 * assets/hero3.js. Without JS the "tilt" variant shows, fully static.
 */
.hx3-v{display:none}
html:not([data-hero]) .hx3--tilt,
html[data-hero="tilt"] .hx3--tilt,
html[data-hero="ra97"] .hx3--ra97,
html[data-hero="draw"] .hx3--draw{display:block}

.hx3-in{
  max-width:1320px;margin:0 auto;padding:56px 40px;
  display:grid;column-gap:64px;row-gap:24px;align-items:center;
}
.hx3-head{display:flex;flex-direction:column;gap:16px;min-width:0}
.hx3-body{display:flex;flex-direction:column;gap:22px;min-width:0}
.hx3-title{
  margin:0;font-weight:700;color:var(--ink);
  font-size:clamp(38px,5vw,72px);line-height:.98;letter-spacing:-.02em;
  /* no automatic hyphenation: it split "installa-tøren" even with limits.
     Titles are sized so the longest word in all 7 languages fits; break-word
     is only a last-resort guard against horizontal scroll */
  overflow-wrap:break-word;hyphens:manual;
}
.hx3-title .accent{color:#e25c00}           /* 3:1 on the paper ground at display size */
.hx3-sub{font-size:18px;line-height:1.55;color:var(--ink-2);max-width:470px}
.hx3-cta{display:flex;gap:12px;flex-wrap:wrap}
.hx3-cta .btn{padding:20px 32px;font-size:12px;letter-spacing:.18em;justify-content:center}
.hx3-tag{
  position:absolute;padding:6px 10px;font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  font-weight:700;background:rgba(30,27,24,.8);color:#f6f4ef;z-index:2;white-space:nowrap;
}
.hx3-micro{font-size:11px;letter-spacing:.16em;text-transform:uppercase;font-weight:700;color:#6b655e}

/* pause / play — WCAG 2.2.2: anything moving >5 s must be stoppable */
.hx3-pause{
  position:absolute;width:44px;height:44px;border-radius:50%;z-index:3;
  border:1px solid #cfc8bd;display:flex;align-items:center;justify-content:center;cursor:pointer;
}
.hx3-pause svg{width:14px;height:14px;fill:currentColor}
.hx3-pause .i-play{display:none}
.hx3.is-paused .hx3-pause .i-play{display:block}
.hx3.is-paused .hx3-pause .i-pause{display:none}

/* range sliders */
.hx3-range{-webkit-appearance:none;appearance:none;width:100%;height:44px;background:transparent;margin:0;cursor:pointer}
.hx3-range::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:#cfc8bd}
.hx3-range::-webkit-slider-thumb{-webkit-appearance:none;width:24px;height:24px;border-radius:50%;background:#fff;border:2px solid var(--ink);margin-top:-10px}
.hx3-range::-moz-range-track{height:4px;border-radius:2px;background:#cfc8bd}
.hx3-range::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:#fff;border:2px solid var(--ink)}
.hx3-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap}

/* ============ A · Tilt360 ============ */
.hx3--tilt{background:#f6f4ef}
.hx3--tilt .hx3-in{grid-template-columns:minmax(0,480px) minmax(0,1fr);grid-template-areas:"head stage" "body stage"}
.hx3--tilt .hx3-head{grid-area:head;align-self:end}
.hx3--tilt .hx3-body{grid-area:body;align-self:start}
.hx3-tiltwrap{grid-area:stage;min-width:0;position:relative}   /* the control card overlays the stage on desktop, sits under it on mobile */
.hx3-tstage{position:relative;overflow:hidden;background:#1e1b18;height:clamp(380px,40vw,580px);--x:61.7}
.hx3-tstage img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hx3-tstage .bg{filter:brightness(.36) saturate(.7)}
.hx3-tstage .lit{
  -webkit-mask-image:radial-gradient(ellipse 24% 44% at calc(var(--x) * 1%) 60%,#000 35%,transparent 100%);
          mask-image:radial-gradient(ellipse 24% 44% at calc(var(--x) * 1%) 60%,#000 35%,transparent 100%);
}
.hx3-ceil{position:absolute;top:0;left:0;right:0;height:30px;background:#efebe4;border-bottom:1px solid #cfc8bd;box-shadow:0 8px 18px rgba(0,0,0,.35);z-index:1}
.hx3-cone{position:absolute;inset:0;width:100%;height:100%;filter:blur(5px);pointer-events:none}
.hx3-spot{position:absolute;top:9px;left:50%;width:110px;height:auto;margin-left:-55px;overflow:visible;z-index:2}
.hx3--tilt .hx3-tag{top:46px;left:16px}
.hx3--tilt .hx3-pause{right:16px;top:42px;background:rgba(30,27,24,.78);color:#f6f4ef}
.hx3-tcard{position:absolute;right:20px;bottom:20px;width:320px;z-index:2;background:rgba(255,253,248,.95);padding:14px 18px 10px}
.hx3-tcard .row{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.hx3-tcard strong{font-size:15px;font-weight:700;color:var(--ink)}
.hx3-tcard .ends{display:flex;justify-content:space-between;font-size:12px;color:#6b655e}
.hx3-chips{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:#6b655e}
.hx3-chips b{padding:8px 12px;border:1px solid #cfc8bd;font-weight:700;letter-spacing:.08em;color:var(--ink);background:#fffdf8}

/* ============ B · Ra 97 ============ */
.hx3--ra97{background:#1e1b18;color:#f6f4ef}
.hx3--ra97 .hx3-in{grid-template-columns:minmax(0,520px) minmax(0,1fr);grid-template-areas:"head stage" "body stage";column-gap:72px}
.hx3--ra97 .hx3-head{grid-area:head;align-self:end}
.hx3--ra97 .hx3-body{grid-area:body;align-self:start}
.hx3--ra97 .eyebrow{color:#cfc8bd}
.hx3--ra97 .hx3-title{color:#f6f4ef;font-size:clamp(36px,3.9vw,56px)}
.hx3--ra97 .hx3-title .red{color:#ff4d4d}
.hx3--ra97 .hx3-sub{color:#cfc8bd}
.hx3--ra97 .btn.ghost{border-color:#f6f4ef;color:#f6f4ef}
.hx3--ra97 .btn.ghost:hover{background:#f6f4ef;color:var(--ink)}
.hx3-97{display:flex;align-items:flex-start;gap:10px;line-height:.78;margin-top:6px}
.hx3-97 .ra{font-size:clamp(28px,3vw,44px);font-weight:700;color:#f6f4ef;margin-top:.4em}
.hx3-97 .n{font-size:clamp(140px,16vw,232px);font-weight:700;letter-spacing:-.05em;color:var(--orange)}
.hx3-cmpwrap{grid-area:stage;display:flex;flex-direction:column;gap:14px;min-width:0}
.hx3-cmp{position:relative;overflow:hidden;background:#000;height:clamp(250px,29vw,420px);--v:50}
.hx3-cmp img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.hx3-cmp .r97{clip-path:inset(0 calc(100% - var(--v) * 1%) 0 0)}
.hx3-cmp .line{position:absolute;top:0;bottom:0;left:calc(var(--v) * 1%);width:2px;margin-left:-1px;background:#fff;box-shadow:0 0 12px rgba(255,255,255,.7);z-index:1}
.hx3-cmp .t97{top:14px;left:14px;background:var(--orange);color:#1e1b18}
.hx3-cmp .t80{top:14px;right:14px}
.hx3--ra97 .hx3-pause{right:16px;bottom:16px;background:rgba(30,27,24,.78);color:#f6f4ef}
.hx3--ra97 .hx3-range::-webkit-slider-runnable-track{background:#4a443e}
.hx3--ra97 .hx3-range::-moz-range-track{background:#4a443e}
.hx3-sw{display:grid;grid-template-columns:repeat(15,minmax(0,1fr));gap:6px}
.hx3-sw span{display:block;height:30px;border-radius:2px}
.hx3-sw .r9{box-shadow:0 0 0 2px #1e1b18,0 0 0 4px var(--orange)}
.hx3-swcap{font-size:12px;letter-spacing:.08em;color:#a39c91}

/* ============ C · Tegning ============ */
.hx3--draw{
  background-color:#f6f4ef;
  background-image:linear-gradient(#ebe5da 1px,transparent 1px),linear-gradient(90deg,#ebe5da 1px,transparent 1px);
  background-size:32px 32px;
}
.hx3--draw .hx3-in{
  padding-top:44px;padding-bottom:40px;align-items:stretch;
  grid-template-columns:minmax(0,1fr) 400px;grid-template-areas:"head body" "draw photo" "facts facts";
}
.hx3--draw .hx3-head{grid-area:head;align-self:end}
.hx3--draw .hx3-body{grid-area:body;align-self:end}
.hx3--draw .hx3-title{font-size:clamp(34px,3.7vw,54px)}
.hx3-dcard{grid-area:draw;background:#fffdf8;border:1px solid var(--hair);padding:16px 28px 8px;display:flex;flex-direction:column;gap:4px;min-width:0}
.hx3-dcard svg{width:100%;max-width:560px;height:auto;align-self:center;overflow:visible;font-family:inherit}
.hx3-pcard{grid-area:photo;position:relative;overflow:hidden;background:#fff;border:1px solid var(--hair);min-height:300px;display:flex;align-items:center;justify-content:center}
.hx3-pcard img{position:relative;width:72%;height:auto}
.hx3-pcard .halo{position:absolute;inset:0;background:radial-gradient(circle at 50% 50%,rgba(255,150,60,.42),rgba(255,105,0,0) 62%)}
.hx3-pcard .glow{position:absolute;left:50%;top:49%;width:120px;height:120px;margin:-60px 0 0 -60px;border-radius:50%;
  background:radial-gradient(circle,rgba(255,214,150,.95) 0%,rgba(255,160,70,.55) 35%,rgba(255,105,0,0) 70%)}
.hx3-pcard .hx3-tag{left:12px;bottom:12px}
.hx3--draw .hx3-pause{right:14px;bottom:14px;background:rgba(255,253,248,.94);color:var(--ink)}
.hx3-facts{grid-area:facts;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.hx3-facts div{display:flex;flex-direction:column;gap:4px;padding:14px 16px;background:#fffdf8;border:1px solid var(--hair)}
.hx3-facts strong{font-size:22px;font-weight:700;color:var(--ink);white-space:nowrap}
.hx3-facts span{font-size:11px;letter-spacing:.14em;text-transform:uppercase;font-weight:700;color:#6b655e}

/* ---- animation (only for people who have not asked for less motion) ---- */
.d8-draw{stroke-dasharray:100;stroke-dashoffset:0}
@media (prefers-reduced-motion: no-preference){
  .hx3 .d8-draw{animation:hx3draw 12s ease-in-out infinite}
  .hx3 .d8-dim{animation:hx3dim 12s ease-out infinite}
  .hx3 .d8-beam{animation:hx3beam 12s ease-in-out infinite}
  .hx3 .sw{animation:hx3sw 3.6s ease-in-out infinite}
  .hx3 .r9{animation:hx3r9 1.8s ease-in-out infinite}
}
.hx3.is-paused *,.hx3.is-offscreen *{animation-play-state:paused!important}
@keyframes hx3draw{0%{stroke-dashoffset:100;opacity:1}28%{stroke-dashoffset:0}90%{stroke-dashoffset:0;opacity:1}97%,100%{stroke-dashoffset:0;opacity:0}}
@keyframes hx3dim{0%,30%{opacity:0}38%,90%{opacity:1}97%,100%{opacity:0}}
@keyframes hx3beam{0%,46%{opacity:0}58%,90%{opacity:1}97%,100%{opacity:0}}
@keyframes hx3sw{0%,100%{transform:none;filter:none}50%{transform:translateY(-3px);filter:brightness(1.18)}}
@keyframes hx3r9{0%,100%{box-shadow:0 0 0 2px #1e1b18,0 0 0 4px #ff6900}50%{box-shadow:0 0 0 2px #1e1b18,0 0 0 8px #ff6900}}
@media (prefers-reduced-motion: reduce){.hx3-pause{display:none}}

/* The CTA band under the hero keeps only the USP strip now */
.hero-cta{padding-bottom:0}
.hero-cta .usp-strip{margin-bottom:0}

/* ============ mobile ============ */
@media (max-width: 900px){
  .hx3-in{padding:28px 20px 36px;column-gap:0;row-gap:20px}
  .hx3--tilt .hx3-in,.hx3--ra97 .hx3-in{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "stage" "body"}
  .hx3--draw .hx3-in{grid-template-columns:minmax(0,1fr);grid-template-areas:"head" "photo" "draw" "facts" "body"}
  .hx3-title{font-size:clamp(34px,10.4vw,46px);line-height:1}
  .hx3--ra97 .hx3-title{font-size:clamp(32px,9.6vw,42px)}
  .hx3--draw .hx3-title{font-size:clamp(30px,9vw,40px)}
  .hx3-sub{font-size:17px}
  .hx3-cta{flex-direction:column}
  .hx3-cta .btn{width:100%;max-width:none}
  .hx3-tstage{height:auto;aspect-ratio:4/3}
  .hx3-tiltwrap{padding-top:0}
  .hx3-tcard{position:static;width:auto;margin-top:12px;background:#fffdf8;border:1px solid var(--hair)}
  .hx3-spot{width:84px;margin-left:-42px}
  .hx3-97 .n{font-size:clamp(110px,36vw,150px)}
  .hx3-cmp{height:auto;aspect-ratio:7/5}
  .hx3-cmp .t80{top:auto;right:auto;left:14px;bottom:14px}   /* two top tags collide in fi/de on a phone */
  .hx3-sw{gap:4px}
  .hx3-sw span{height:18px}
  .hx3-dcard{padding:12px 10px 4px}
  .hx3-pcard{min-height:0;aspect-ratio:7/5}
  .hx3-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hx3-facts strong{font-size:18px}
  .hx3-facts div{padding:12px}
  .hx3-facts span{font-size:10px;letter-spacing:.06em}   /* 'Indbygningsdybde' / 'Innfellingsdybde' must fit half a phone */
}
