/* =========================================================
   VÄLJAREN — Cranepartner (behovsingång gjord till hjälte)
   Vit bas · Magni-röd #AE171A endast på aktivt val + EN CTA ·
   grå #2F383C som text · Open Sans + IBM Plex Mono.
   Endast transform/opacity i rörelse. Verktygslikt, rent, premium.
   ========================================================= */

:root {
  --red: #AE171A;
  --ink: #2F383C;
  --white: #FFFFFF;

  --ink-70: rgba(47, 56, 60, 0.70);
  --ink-55: rgba(47, 56, 60, 0.55);
  --ink-40: rgba(47, 56, 60, 0.40);

  --paper: #f6f7f7;             /* off-white panel fill, still neutral */
  --rule: rgba(47, 56, 60, 0.14);
  --rule-strong: rgba(47, 56, 60, 0.26);

  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 56px);
  --colgap: clamp(16px, 2vw, 28px);

  --sans: "Open Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;

  --sec-y: clamp(72px, 11vw, 120px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* token bridge so the shared till-salu engine themes correctly even if
   this stylesheet is loaded near it (defensive; the till-salu page also
   maps these explicitly) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
ul { list-style: none; padding: 0; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}
.num--red { color: var(--red); }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 700; font-size: 15px;
  padding: 14px 22px; border: 1px solid transparent; border-radius: 3px;
  cursor: pointer; transition: transform .18s var(--ease), background .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: #960f12; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { border-color: var(--ink); }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav__inner { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.nav__logo img { height: 30px; width: auto; }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a {
  font-size: 14px; font-weight: 600; color: var(--ink-70);
  padding: 6px 0; border-bottom: 2px solid transparent;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.nav__links a:hover { color: var(--ink); border-color: var(--red); }
.nav__call { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.nav__call-label { font-size: 11px; color: var(--ink-55); }
.nav__call .mono { font-size: 14px; font-weight: 600; color: var(--ink); }

@media (max-width: 1000px) {
  .nav__links { display: none; }
}

/* =========================================================
   HERO = VÄLJAREN
   ========================================================= */
.valjaren { border-bottom: 1px solid var(--rule); }
.valjaren__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: stretch;
  padding-block: clamp(48px, 7vw, 88px);
}
.valjaren__panel { display: flex; flex-direction: column; }
.valjaren__title {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 800; line-height: 1.04; letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.valjaren__lede {
  font-size: clamp(16px, 1.4vw, 19px); color: var(--ink-70);
  max-width: 46ch; margin-bottom: clamp(28px, 4vw, 40px);
}

/* controls */
.ctrl { display: flex; flex-direction: column; gap: clamp(22px, 3vw, 30px); }
.ctrl__row { display: flex; flex-direction: column; gap: 10px; }
.ctrl__head { display: flex; align-items: baseline; justify-content: space-between; }
.ctrl__label { font-size: 14px; font-weight: 700; letter-spacing: 0.01em; }
.ctrl__val { font-size: 22px; font-weight: 600; color: var(--red); }
.ctrl__scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-40); }

.ctrl__range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 99px;
  background: var(--rule-strong); cursor: pointer;
}
.ctrl__range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--red); border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--rule-strong);
  transition: transform .15s var(--ease);
}
.ctrl__range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.ctrl__range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--red); border: 3px solid #fff;
}
.ctrl__range::-moz-range-track { height: 4px; border-radius: 99px; background: var(--rule-strong); }

/* segmented toggle */
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 3px; overflow: hidden; }
.seg__btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 18px; background: var(--white); color: var(--ink-70);
  border: none; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease);
}
.seg__btn + .seg__btn { border-left: 1px solid var(--rule-strong); }
.seg__btn.is-on { background: var(--red); color: #fff; }

/* result panel */
.result {
  display: grid; grid-template-columns: minmax(150px, 0.8fr) 1.2fr;
  gap: clamp(18px, 2vw, 28px);
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 4px; padding: clamp(20px, 2.4vw, 32px);
}
.result__media { position: relative; margin: 0; align-self: stretch; }
.result__media img {
  width: 100%; height: 100%; max-height: 360px; object-fit: contain;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.result.is-swapping .result__media img { opacity: 0; transform: translateY(8px); }
.result__fam {
  position: absolute; left: 0; bottom: 0;
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-55);
}
.result__body { display: flex; flex-direction: column; }
.result__eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-55); }
.result__model { font-size: clamp(28px, 3vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 6px; }
.result__note { font-size: 14px; color: var(--ink-70); margin-bottom: 18px; }

.spec { display: grid; gap: 0; margin-bottom: 22px; }
.spec > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--rule);
}
.spec dt { font-size: 13px; color: var(--ink-55); }
.spec dd { font-size: 14px; font-weight: 500; color: var(--ink); text-align: right; }

.result__cta { margin-top: auto; }
#result-cta { margin-top: auto; }
.result__sheet { margin-top: 12px; font-size: 13px; color: var(--red); }

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding-block: var(--sec-y); border-top: 1px solid var(--rule); }
.section__head { max-width: 60ch; margin-bottom: clamp(32px, 4vw, 52px); }
.section__title { font-size: clamp(26px, 3.2vw, 42px); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; }
.section__lede { margin-top: 16px; font-size: clamp(15px, 1.3vw, 18px); color: var(--ink-70); }

/* ---------- PRODUKTBLAD: familjekort ---------- */
.fam {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--colgap);
}
.fam__card {
  display: flex; flex-direction: column;
  border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
  background: var(--white);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.fam__card:hover { transform: translateY(-3px); border-color: var(--rule-strong); }
.fam__card--lead { border-color: var(--rule-strong); }
.fam__media {
  aspect-ratio: 4 / 3; background: var(--paper);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fam__media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.fam__media--type { background: var(--ink); }
.fam__glyph { color: #fff; font-size: 54px; opacity: 0.85; }
.fam__body { display: flex; flex-direction: column; gap: 10px; padding: 18px; flex: 1; }
.fam__tag { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-55); }
.fam__name { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.fam__spec { display: grid; gap: 0; }
.fam__spec > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.fam__spec dt { color: var(--ink-55); }
.fam__spec dd { font-weight: 500; }
.fam__sheet { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--red); }
.fam__foot { margin-top: clamp(28px, 4vw, 44px); font-size: clamp(17px, 1.6vw, 22px); color: var(--ink-70); }
.fam__foot strong { color: var(--ink); }

/* ---------- SERVICE ---------- */
.section--media .section__media {
  border: 1px solid var(--rule); border-radius: 4px; overflow: hidden;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.section--media .section__media img { width: 100%; height: clamp(280px, 40vw, 520px); object-fit: cover; }
.serv__grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--colgap); margin-top: 8px;
}
.serv__grid > div { padding: 18px 0; border-top: 1px solid var(--rule-strong); }
.serv__grid dt { font-size: 18px; font-weight: 600; color: var(--red); margin-bottom: 6px; }
.serv__grid dd { font-size: 14px; color: var(--ink-70); }
.serv__akut { margin-top: clamp(24px, 3vw, 36px); font-size: 16px; }
.serv__tel { font-weight: 600; color: var(--red); }

/* ---------- BEGAGNAT ---------- */
.used { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.used__media { margin: 0; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; }
.used__media img { width: 100%; height: clamp(360px, 46vw, 600px); object-fit: cover; }
.used__stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--colgap); margin: clamp(24px, 3vw, 32px) 0; }
.used__stat dt { font-size: clamp(26px, 3vw, 38px); font-weight: 800; letter-spacing: -0.02em; }
.used__stat dd { font-size: 13px; color: var(--ink-55); margin-top: 4px; }
.used__cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- CTA / KONTAKT ---------- */
.section--cta { background: var(--paper); }
.cta { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.cta__media { margin: 0; border-radius: 4px; overflow: hidden; aspect-ratio: 1; max-width: 320px; }
.cta__media img { width: 100%; height: 100%; object-fit: cover; }
.people { display: grid; grid-template-columns: 1fr 1fr; gap: var(--colgap); margin-bottom: clamp(28px, 4vw, 40px); }
.person { padding: 20px; background: var(--white); border: 1px solid var(--rule); border-radius: 4px; }
.person__role { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.person__name { font-size: 19px; font-weight: 800; margin: 4px 0 8px; }
.person__quote { font-size: 14px; color: var(--ink-70); margin-bottom: 12px; }
.person__tel { display: block; font-size: 18px; font-weight: 600; color: var(--ink); }
.person__mail { display: block; font-size: 13px; color: var(--ink-55); margin-top: 4px; }

.offer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: clamp(20px, 3vw, 32px); background: var(--white); border: 1px solid var(--rule); border-radius: 4px; }
.offer__head { grid-column: 1 / -1; font-weight: 700; font-size: 16px; }
.offer__field { display: flex; flex-direction: column; gap: 6px; }
.offer__field:nth-child(4) { grid-column: 1 / -1; }
.offer__field label { font-size: 13px; color: var(--ink-55); }
.offer__field input { font: inherit; font-size: 15px; padding: 11px 12px; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--white); color: var(--ink); }
.offer button { grid-column: 1 / -1; }

/* =========================================================
   FOOTER
   ========================================================= */
.foot { border-top: 1px solid var(--rule-strong); padding-block: clamp(48px, 7vw, 80px) 0; }
.foot__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: clamp(24px, 3vw, 40px); }
.foot__brand img { height: 28px; width: auto; margin-bottom: 12px; }
.foot__tag { font-size: 12px; color: var(--ink-55); }
.foot__h { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-55); margin-bottom: 10px; }
.foot__col p { font-size: 14px; color: var(--ink-70); margin-bottom: 8px; }
.foot__col a { font-size: 14px; color: var(--ink); }
.foot__col a:hover { color: var(--red); }
.foot__base { margin-top: clamp(36px, 5vw, 56px); padding-block: 24px; border-top: 1px solid var(--rule); }
.foot__base p { font-size: 12px; color: var(--ink-55); }

/* =========================================================
   STICKY MOBIL-RINGLIST
   ========================================================= */
.ringbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; gap: 1px; background: var(--rule-strong);
  border-top: 1px solid var(--rule-strong);
}
.ringbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 11px 8px; background: var(--red); color: #fff; line-height: 1.1;
}
.ringbar a span:first-child { font-size: 11px; opacity: 0.85; }
.ringbar a .mono { font-size: 15px; font-weight: 600; }
.ringbar--alt { background: var(--ink) !important; }

@media (max-width: 767px) {
  .ringbar { display: flex; }
  body { padding-bottom: 64px; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .valjaren__grid { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .result__media img { max-height: 280px; }
  .used { grid-template-columns: 1fr; }
  .used__media img { height: clamp(280px, 60vw, 420px); }
  .cta { grid-template-columns: 1fr; }
  .cta__media { max-width: 220px; }
  .people { grid-template-columns: 1fr; }
  .offer { grid-template-columns: 1fr; }
  .offer__field:nth-child(4) { grid-column: auto; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .used__stat { grid-template-columns: 1fr; gap: 12px; }
  .foot__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   REVEAL — only transform/opacity; reduced-motion shows all.
   Progressive enhancement: content is hidden ONLY when JS has
   confirmed it can drive the reveal (html.js). Without JS, or if
   the observer never fires, content always stays visible — the
   page can never get stuck as a blank white band.
   ========================================================= */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-in { opacity: 1 !important; transform: none !important; transition: none !important; }
  .result__media img { transition: none !important; }
  .btn, .fam__card, .ctrl__range::-webkit-slider-thumb, .seg__btn { transition: none !important; }
  .btn:hover, .fam__card:hover { transform: none !important; }
}
