/* ============================================================
   Cranepartner Sweden — V1 GENERALAGENTEN
   Magni Brandbook 2025 exekverad: vit bas, röd röst.
   Endast: #AE171A (röd) · #2F383C (grå/"svart") · #FFFFFF (vit).
   ============================================================ */

:root {
  --red:      #AE171A;
  --red-dim:  #8f1316;          /* hover-djup, samma kulör mörkare */
  --ink:      #2F383C;          /* sidans "svart": brödtext + rubriker */
  --ink-60:   rgba(47, 56, 60, 0.60);
  --ink-40:   rgba(47, 56, 60, 0.40);
  --ink-14:   rgba(47, 56, 60, 0.14);
  --ink-08:   rgba(47, 56, 60, 0.08);
  --paper:    #FFFFFF;

  --rail-w:   84px;             /* måttlinjens spalt på desktop */

  --maxw:     1280px;
  --gut:      clamp(20px, 5vw, 64px);

  /* 8-bas spacingskala */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px; --s9: 160px;

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

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--ff-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.skip-link {
  position: absolute; left: var(--s2); top: -120px;
  z-index: 200; background: var(--red); color: #fff;
  padding: var(--s2) var(--s3); font-weight: 700;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: var(--s2); }

/* ---- type primitives -------------------------------------- */
.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 0.6em;
  margin-bottom: var(--s3);
}
.eyebrow::before {
  content: ""; width: 28px; height: 2px; background: var(--red);
  display: inline-block;
}

.section__title {
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.04;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  text-transform: none;
  max-width: 18ch;
}
.section__intro {
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
  color: var(--ink-60);
  max-width: 56ch;
  margin-top: var(--s3);
}

.is-red { color: var(--red); }

/* ============================================================
   MÅTTLINJEN — signaturmoment: röd mätsticka i vänstermarginalen
   ============================================================ */
.measure-rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 60;
  pointer-events: none;
  display: none;                 /* visas ≥1024px */
}
.measure-rail__line {
  position: absolute;
  left: calc(var(--rail-w) - 1px);
  top: 0; bottom: 0;
  width: 1px;
  background: var(--ink-14);
}
.measure-rail__line::after {     /* den röda "uppnådda" delen ritas av JS-höjd */
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 1px;
  height: var(--rail-progress, 0%);
  background: var(--red);
}
.measure-tick {
  position: absolute;
  right: calc(var(--rail-w) - 1px);
  transform: translate(0, -50%);
  top: var(--tick-top, 50%);
  display: flex; align-items: baseline; gap: 4px;
  padding-right: 12px;
  font-family: var(--ff-mono);
  color: var(--ink-40);
  transition: color .5s var(--ease), opacity .5s var(--ease);
  opacity: 0.5;
}
.measure-tick::after {           /* tickmärket mot linjen */
  content: "";
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 1px; background: currentColor;
}
.measure-tick__val { font-size: 0.82rem; font-weight: 600; }
.measure-tick__unit { font-size: 0.6rem; }
.measure-tick.is-reached { color: var(--red); opacity: 1; }

/* sektionerna får luft för rälsen på desktop */
@media (min-width: 1024px) {
  .measure-rail { display: block; }
  .nav__inner,
  .section { padding-left: calc(var(--gut) + var(--rail-w)); }
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--ink-08);
}
.nav__inner {
  max-width: calc(var(--maxw) + var(--rail-w));
  margin: 0 auto;
  padding: var(--s2) var(--gut);
  display: flex; align-items: center; gap: var(--s4);
}
.nav__logo img { height: 26px; width: auto; }
.nav__links { display: none; gap: var(--s4); margin-left: auto; }
.nav__links a {
  font-size: 0.86rem; font-weight: 600; color: var(--ink);
  position: relative; padding: 4px 0;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 0; height: 2px; background: var(--red);
  transition: width .3s var(--ease);
}
.nav__links a:hover::after { width: 100%; }

.nav__call {
  margin-left: auto;
  display: flex; flex-direction: column; align-items: flex-end;
  line-height: 1.15;
}
.nav__call-label {
  font-family: var(--ff-mono); font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-40);
}
.nav__call-num { font-weight: 800; color: var(--red); font-size: 1.02rem; }
@media (min-width: 860px) { .nav__links { display: flex; } .nav__call { margin-left: 0; } }

/* ============================================================
   SECTION skeleton
   ============================================================ */
.section {
  max-width: calc(var(--maxw) + var(--rail-w));
  margin: 0 auto;
  padding: var(--s8) var(--gut);
  position: relative;
}
.section__head { max-width: var(--maxw); }

.section__lead-media {
  position: relative;
  margin-bottom: var(--s6);
  overflow: hidden;
  background: var(--ink-08);
}
.section__lead-media img {
  width: 100%; height: clamp(220px, 34vw, 420px);
  object-fit: cover; object-position: center 38%;
}
.section__lead-media--portrait { max-width: 360px; }
.section__lead-media--portrait img { height: clamp(360px, 56vw, 560px); object-position: center 30%; }
.section__lead-media--wide img { height: clamp(260px, 42vw, 520px); }
.section__lead-media--split {
  display: grid; grid-template-columns: 280px 1fr; gap: var(--s1);
  background: transparent;
}
.section__lead-media--split img { height: clamp(260px, 36vw, 420px); }
.section__lead-media--split img:first-child { object-position: center 20%; background: var(--ink-08); }
@media (max-width: 640px) {
  .section__lead-media--split { grid-template-columns: 1fr; }
  .section__lead-media--split img:first-child { height: 280px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: var(--s6);
  padding-bottom: var(--s8);
}
.hero__media {
  position: relative;
  overflow: hidden;
  background: var(--ink-08);
  margin-bottom: var(--s6);
}
.hero__media img {
  width: 100%;
  height: clamp(280px, 52vh, 560px);
  object-fit: cover; object-position: center 42%;
}
.hero__panel { max-width: var(--maxw); }

.hero__title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.98;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  margin: var(--s2) 0 var(--s4);
}
.hero__title span { display: block; }
.hero__title .is-red { color: var(--red); }

.hero__lede {
  font-size: clamp(1.1rem, 1.9vw, 1.5rem);
  max-width: 46ch;
  color: var(--ink);
  font-weight: 400;
}

.hero__stats {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: var(--s5);
  margin: var(--s6) 0;
  padding-top: var(--s5);
  border-top: 1px solid var(--ink-14);
}
.hero__stats li { display: flex; flex-direction: column; }
.stat__num {
  font-family: var(--ff-mono);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.hero__stats .stat__num { color: var(--red); }
.stat__unit {
  font-family: var(--ff-mono); font-size: 0.86rem;
  color: var(--ink-40); margin-top: 4px; text-transform: lowercase;
}
.stat__label { font-size: 0.84rem; color: var(--ink-60); margin-top: var(--s1); max-width: 22ch; }

.hero__cta { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.hero__note {
  font-style: italic; color: var(--ink-60); font-size: 0.98rem;
}

/* ---- buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-weight: 700; font-size: 1rem;
  padding: var(--s2) var(--s4);
  border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
  cursor: pointer;
}
.btn__icon { font-weight: 800; }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-dim); transform: translateY(-2px); }
.btn--ghost-red {
  background: transparent; color: var(--red);
  border-color: var(--red); font-family: var(--ff-mono);
  font-size: 1.2rem; letter-spacing: 0.02em;
}
.btn--ghost-red:hover { background: var(--red); color: #fff; transform: translateY(-2px); }

/* ============================================================
   PRODUKTBLAD
   ============================================================ */
.spec-key {
  display: flex; flex-wrap: wrap; gap: var(--s4);
  margin-top: var(--s4);
  font-family: var(--ff-mono); font-size: 0.78rem;
  color: var(--ink-60);
}
.spec-key span { display: inline-flex; align-items: center; gap: 0.5em; }
.spec-key__dot { width: 9px; height: 9px; background: var(--ink); display: inline-block; }
.spec-key__dot--max { background: var(--red); }
.spec-key__dot--reach { background: var(--ink-40); }

.card-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 1px;
  background: var(--ink-14);             /* hairline-rutnät syns via gap */
  border: 1px solid var(--ink-14);
  margin-top: var(--s6);
}
.card {
  background: var(--paper);
  display: flex; flex-direction: column;
  position: relative;
}
.card--feature { outline: 2px solid var(--red); outline-offset: -2px; z-index: 1; }
.card__media {
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(180deg, #fff 0%, #fafafa 100%);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
  overflow: hidden;
}
.card__media img { max-height: 100%; width: auto; object-fit: contain; }
.card__body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); flex: 1; }
.card__family {
  font-family: var(--ff-mono); font-size: 0.68rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-40);
}
.card__model {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em;
}
.card--feature .card__model { color: var(--red); }

.spec { display: flex; flex-direction: column; margin-top: var(--s1); }
.spec__row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--ink-14);
}
.spec__row dt {
  font-size: 0.8rem; color: var(--ink-60);
}
.spec__row dd {
  font-family: var(--ff-mono); font-weight: 600;
  font-size: 1rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.spec__row--max dd { color: var(--red); }
.spec__row--max dt { color: var(--red); }

.card__sheet {
  margin-top: auto;
  font-family: var(--ff-mono); font-size: 0.8rem; font-weight: 600;
  color: var(--ink); letter-spacing: 0.02em;
  display: inline-flex; align-items: center; gap: 0.5em;
  padding-top: var(--s2);
  border-top: 1px solid var(--ink);
  transition: color .2s var(--ease), gap .2s var(--ease);
}
.card__sheet:hover { color: var(--red); gap: 0.9em; }
.card__sheet--ask { border-top-color: var(--ink-40); color: var(--ink-60); }

.products__more {
  margin-top: var(--s6);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5);
}
.products__more p { font-size: 0.92rem; color: var(--ink-60); }
.products__pdfs { display: flex; flex-wrap: wrap; gap: var(--s3); }
.products__pdfs a {
  font-family: var(--ff-mono); font-size: 0.84rem; font-weight: 600;
  color: var(--ink); border-bottom: 2px solid var(--ink-14);
  padding-bottom: 3px; transition: border-color .2s var(--ease), color .2s var(--ease);
}
.products__pdfs a:hover { color: var(--red); border-color: var(--red); }

/* ============================================================
   SERVICE
   ============================================================ */
.service__grid {
  display: grid; grid-template-columns: 1fr; gap: var(--s6);
  margin-top: var(--s6);
}
@media (min-width: 880px) {
  .service__grid { grid-template-columns: 0.9fr 1.4fr; gap: var(--s7); align-items: start; }
}
.service__stats { list-style: none; display: flex; flex-direction: column; gap: var(--s4); }
.service__stats li {
  display: flex; flex-direction: column;
  padding-bottom: var(--s4); border-bottom: 1px solid var(--ink-14);
}
.service__stats .stat__num { color: var(--red); }

.service__list { list-style: none; display: flex; flex-direction: column; }
.service__list li {
  position: relative;
  padding: var(--s4) 0 var(--s4) var(--s4);
  border-top: 1px solid var(--ink-14);
  font-size: 1.04rem; color: var(--ink);
}
.service__list li:last-child { border-bottom: 1px solid var(--ink-14); }
.service__rule {
  position: absolute; left: 0; top: var(--s4);
  width: 3px; height: 1.4em; background: var(--red);
}

.service__jour {
  margin-top: var(--s7);
  background: var(--red);
  color: #fff;
  padding: var(--s5) var(--gut);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--s4);
}
.service__jour-line {
  font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 800;
  text-transform: uppercase; letter-spacing: -0.01em;
}
.service__jour .btn--ghost-red { border-color: #fff; color: #fff; }
.service__jour .btn--ghost-red:hover { background: #fff; color: var(--red); }

.depots {
  list-style: none;
  margin-top: var(--s7);
  display: grid; grid-template-columns: 1fr; gap: 1px;
  background: var(--ink-14); border: 1px solid var(--ink-14);
}
@media (min-width: 720px) { .depots { grid-template-columns: 1fr 1fr; } }
.depot { background: var(--paper); padding: var(--s5); }
.depot h3 { font-size: 1.3rem; font-weight: 800; }
.depot__addr { font-size: 1.04rem; margin-top: var(--s1); }
.depot__meta { font-size: 0.86rem; color: var(--ink-60); margin: var(--s1) 0 var(--s3); }
.depot > a {
  font-family: var(--ff-mono); font-weight: 600; color: var(--red);
  font-size: 1.04rem; border-bottom: 2px solid var(--red); padding-bottom: 2px;
}

/* ============================================================
   BEGAGNAT & DEMO  (återförsäljningssektionen)
   ============================================================ */
.used__aggregate {
  list-style: none;
  margin-top: var(--s6);
  display: grid; grid-template-columns: 1fr; gap: var(--s5);
  padding-top: var(--s5);
  border-top: 1px solid var(--ink-14);
}
@media (min-width: 720px) { .used__aggregate { grid-template-columns: repeat(3, 1fr); gap: var(--s6); } }
.used__aggregate li { display: flex; flex-direction: column; }
.used__aggregate .stat__num { color: var(--red); }
.used__badge {
  font-family: var(--ff-mono); font-weight: 600;
  font-size: clamp(1.02rem, 2.2vw, 1.4rem); line-height: 1.1;
  color: #fff; background: var(--red);
  align-self: flex-start;
  padding: 8px 14px;
}

.used__grid {
  list-style: none;
  margin-top: var(--s6);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--ink-14);
  border: 1px solid var(--ink-14);
}
.used-card {
  background: var(--paper);
  display: flex; flex-direction: column;
}
.used-card__media {
  aspect-ratio: 4 / 5;
  background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4);
  overflow: hidden;
}
.used-card__media img { max-height: 100%; width: auto; object-fit: contain; }
.used-card__body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.used-card__type {
  align-self: flex-start;
  font-family: var(--ff-mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); border: 1px solid var(--ink-40);
  padding: 4px 9px;
}
.used-card__type--demo { color: #fff; background: var(--red); border-color: var(--red); }
.used-card__name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.01em; }
.used-card__meta {
  font-family: var(--ff-mono); font-size: 0.78rem; color: var(--ink-60);
  font-variant-numeric: tabular-nums;
  padding-top: var(--s2); border-top: 1px solid var(--ink-14);
}

.used__cta {
  margin-top: var(--s7);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4);
}
.btn--ghost-ink {
  background: transparent; color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost-ink:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }
.used__note {
  flex-basis: 100%;
  font-size: 0.86rem; color: var(--ink-40); font-style: italic;
  max-width: 60ch; margin-top: var(--s1);
}

/* ============================================================
   CTA
   ============================================================ */
.cta__head { max-width: var(--maxw); }
.cta__head .section__title { font-size: clamp(1.8rem, 4vw, 3.1rem); max-width: 22ch; }

.cta__people {
  margin-top: var(--s7);
  display: grid; grid-template-columns: 1fr; gap: 1px;
  background: var(--ink-14); border: 1px solid var(--ink-14);
}
@media (min-width: 720px) { .cta__people { grid-template-columns: 1fr 1fr; } }
.person {
  background: var(--paper); padding: var(--s5);
  display: flex; flex-direction: column; gap: var(--s1);
  transition: background .25s var(--ease), color .25s var(--ease);
}
.person:hover { background: var(--red); color: #fff; }
.person__role {
  font-family: var(--ff-mono); font-size: 0.68rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-40);
}
.person:hover .person__role { color: rgba(255,255,255,0.75); }
.person__name { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1; }
.person__num {
  font-family: var(--ff-mono); font-weight: 600; font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--red); margin-top: var(--s1); font-variant-numeric: tabular-nums;
}
.person:hover .person__num { color: #fff; }
.person__hint { font-size: 0.92rem; color: var(--ink-60); font-style: italic; margin-top: var(--s1); }
.person:hover .person__hint { color: rgba(255,255,255,0.85); }

.quote {
  margin-top: var(--s6);
  border: 1px solid var(--ink-14);
  padding: var(--s6);
}
.quote__title { font-size: 1.3rem; font-weight: 700; margin-bottom: var(--s4); }
.quote__fields {
  display: grid; grid-template-columns: 1fr; gap: var(--s4);
}
@media (min-width: 720px) { .quote__fields { grid-template-columns: repeat(3, 1fr); } }
.field { display: flex; flex-direction: column; gap: var(--s1); }
.field__label {
  font-family: var(--ff-mono); font-size: 0.72rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-60);
}
.field input {
  font-family: var(--ff-sans); font-size: 1rem; color: var(--ink);
  padding: 12px 0; border: 0; border-bottom: 2px solid var(--ink-14);
  background: transparent; transition: border-color .2s var(--ease);
}
.field input::placeholder { color: var(--ink-40); }
.field input:focus { outline: none; border-color: var(--red); }
.quote__submit { margin-top: var(--s5); }
.quote__note { font-size: 0.82rem; color: var(--ink-40); margin-top: var(--s3); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink); color: rgba(255,255,255,0.82);
  padding: var(--s7) var(--gut) var(--s5);
}
.footer__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr; gap: var(--s5);
}
@media (min-width: 760px) { .footer__inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer__brand img { height: 24px; width: auto; filter: brightness(0) invert(1); margin-bottom: var(--s2); }
.footer__brand p { font-size: 0.92rem; color: rgba(255,255,255,0.6); }
.footer__col { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.footer__head {
  font-family: var(--ff-mono); font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); margin-bottom: var(--s1);
}
.footer__col a { border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
.footer__col a:hover { border-color: rgba(255,255,255,0.5); }
.footer__legal {
  max-width: var(--maxw); margin: var(--s6) auto 0;
  padding-top: var(--s4); border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8rem; color: rgba(255,255,255,0.5);
}

/* ============================================================
   STICKY MOBIL RINGLIST (<768px)
   ============================================================ */
.thumb-call { display: none; }
@media (max-width: 767px) {
  .thumb-call {
    display: grid; grid-template-columns: 1fr 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    border-top: 1px solid rgba(255,255,255,0.2);
  }
  .thumb-call a {
    background: var(--ink); color: #fff;
    padding: 16px 8px; text-align: center;
    font-weight: 800; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; gap: 0.4em;
  }
  .thumb-call a span { color: var(--red); font-size: 1.2rem; }
  .thumb-call .thumb-call--jour { background: var(--red); }
  .thumb-call .thumb-call--jour span { color: #fff; }
  body { padding-bottom: 64px; }   /* plats för ringlisten */
}

/* ============================================================
   MOTION — reveals (transform/opacity only)
   ============================================================ */
[data-reveal] { opacity: 0; transform: translateY(22px); }
.is-reveal-ready [data-reveal] { will-change: opacity, transform; }

/* reduced-motion: allt statiskt synligt, ingen rörelse */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .measure-tick { opacity: 1; }
  * { scroll-behavior: auto !important; }
}

/* om JS inte körs: visa allt (no-FOUC-fallback hanteras av JS-flagga) */
.no-js [data-reveal] { opacity: 1; transform: none; }
