/* =========================================================
   CRANEPARTNER · BENTO-ÖVERSIKTEN
   Hela erbjudandet som en bento-mosaik. Vit bas, tre kulörer:
   Magni-röd #AE171A · Magni-grå #2F383C · vitt. Open Sans + IBM Plex Mono.
   Plattor avgränsas av 1px-hårlinjer — inga kort-skuggor, inga gradienter.
   EN röd platta (rekordtalet) som ankare. Mobilt = en kolumn, läslogisk ordning.
   ========================================================= */

: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);

  --rule: rgba(47, 56, 60, 0.14);        /* 1px hårlinje */
  --rule-strong: rgba(47, 56, 60, 0.26);

  --surface: #FFFFFF;
  --surface-2: #FAFAFA;                   /* nästan-vit platta-fyllning, ej grå */

  --maxw: 1320px;
  --gutter: clamp(20px, 5vw, 56px);
  --bento-gap: 1px;                        /* hårlinjen ÄR mellanrummet */
  --pad: clamp(20px, 2.4vw, 36px);

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

  --sec-y: clamp(72px, 10vw, 120px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* , *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- NAV ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav__inner {
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
  min-height: 68px;
}
.nav__logo img { height: 30px; width: auto; }
.nav__links {
  display: flex; gap: clamp(14px, 1.8vw, 28px);
  margin-left: auto;
  font-size: 14px; font-weight: 600;
}
.nav__links a { text-decoration: none; color: var(--ink-70); padding: 6px 0; position: relative; }
.nav__links a:hover { color: var(--ink); }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); }
.nav__cta {
  text-decoration: none; font-weight: 700; font-size: 14px;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 3px;
  white-space: nowrap; transition: background .2s ease;
}
.nav__cta:hover { background: var(--red); }

/* ====================================================
   BENTO — det gemensamma rutnätet
   12-kol mosaik; plattor spannar 1–2 rader/kolumner.
   Hårlinjen skapas av en grå "matris-bakgrund" bakom 1px-gap.
   ==================================================== */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--bento-gap);
  background: var(--rule);                 /* hårlinjen lyser genom gapet */
  border: 1px solid var(--rule);
}

.tile {
  background: var(--surface);
  padding: var(--pad);
  display: flex; flex-direction: column;
  min-width: 0;
  position: relative;
  grid-column: span 4;                     /* default-platta = 1/3 */
}

/* hover-lyft (endast transform) */
.tile[data-tile] { transition: transform .35s var(--ease), background-color .35s var(--ease); }
.tile[data-tile]:hover { background: var(--surface-2); }
.tile--media[data-tile]:hover, a.tile[data-tile]:hover { background: var(--surface); }
a.tile[data-tile]:hover { transform: translateY(-3px); }

.tile__eyebrow, .tile__kicker {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-55); margin: 0 0 14px;
}

/* ---------------- HERO-BENTO ---------------- */
.bento--hero { margin-top: clamp(28px, 5vw, 56px); }

.tile--lead {
  grid-column: span 7; grid-row: span 2;
  justify-content: center;
  padding-block: clamp(36px, 5vw, 64px);
}
.tile__h1 {
  font-size: clamp(34px, 5.4vw, 68px);
  line-height: 1.02; letter-spacing: -0.025em; font-weight: 800;
  margin: 0 0 22px; color: var(--ink);
}
.tile__lede { font-size: clamp(17px, 1.5vw, 21px); max-width: 38ch; margin: 0 0 10px; color: var(--ink-70); }
.tile__sub { font-weight: 700; color: var(--ink); margin: 0; }

.tile--render { grid-column: span 5; grid-row: span 2; padding: 0; overflow: hidden; align-items: stretch; }
.tile--render img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* DEN RÖDA PLATTAN — ankaret */
.tile--red {
  grid-column: span 4;
  background: var(--red); color: #fff;
  justify-content: center;
}
.tile--red .tile__eyebrow, .record__label { color: rgba(255,255,255,0.82); }
.record__label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px; }
.record__figs { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.record__num { font-size: clamp(44px, 6vw, 76px); font-weight: 600; line-height: 1; }
.record__unit { font-size: clamp(18px, 2vw, 26px); font-weight: 700; }
.record__div { font-size: clamp(30px, 4vw, 48px); opacity: .55; font-weight: 300; }
.record__cap { font-size: 12px; color: rgba(255,255,255,0.85); margin: 0; letter-spacing: .02em; }

.tile--cta {
  grid-column: span 4; text-decoration: none;
  background: var(--ink); color: #fff; justify-content: center;
}
.cta__label { font-size: clamp(20px, 2.2vw, 28px); font-weight: 800; }
.cta__arrow { font-size: 28px; transition: transform .3s var(--ease); display: inline-block; margin: 6px 0 10px; }
.tile--cta:hover .cta__arrow { transform: translateX(8px); }
.cta__sub { font-size: 14px; color: rgba(255,255,255,0.72); }

.tile--need { grid-column: span 4; justify-content: center; }
.need__line { font-size: clamp(19px, 2vw, 26px); font-weight: 700; margin: 0 0 16px; letter-spacing: -0.01em; }
.need__pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.pill { font-size: 12px; padding: 5px 11px; border: 1px solid var(--rule-strong); border-radius: 99px; color: var(--ink-70); }

/* ---------------- SEKTIONSHUVUDEN ---------------- */
.sec { padding-block: var(--sec-y); }
.sec__head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 72ch; }
.sec__title { font-size: clamp(28px, 3.6vw, 46px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; line-height: 1.05; }
.sec__intro { font-size: clamp(16px, 1.3vw, 19px); color: var(--ink-70); margin: 0; max-width: 60ch; }

/* ---------------- PRODUKT-BENTO ---------------- */
.bento--products { grid-auto-rows: minmax(0, auto); }
.tile--product { grid-column: span 4; padding: 0; }
.tile--prod-lg { grid-column: span 8; grid-row: span 2; flex-direction: row; }
.tile--prod-lg .tile__media { flex: 1 1 48%; }
.tile--prod-lg .tile__pad { flex: 1 1 52%; }
.tile--prod-text { padding: 0; }

.tile__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--rule); }
.tile--prod-lg .tile__media { aspect-ratio: auto; border-bottom: none; border-right: 1px solid var(--rule); }
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tile__media--render { background: var(--surface-2); }
.tile__media--render img { object-fit: contain; padding: 18px; }
.tile--product:hover .tile__media img { transform: scale(1.04); }
.tile__media--render:hover img, .tile--product:hover .tile__media--render img { transform: scale(1.03); }

.tile__pad { padding: var(--pad); display: flex; flex-direction: column; gap: 10px; flex: 1; }
.prod__fam { font-size: 12px; letter-spacing: .06em; color: var(--red); margin: 0; font-weight: 500; }
.prod__name { font-size: clamp(18px, 1.8vw, 24px); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.prod__desc { font-size: 14.5px; color: var(--ink-70); margin: 0; }
.prod__foot { font-size: 14px; font-weight: 700; color: var(--ink); margin: auto 0 0; }

.spec { display: grid; gap: 0; margin: 6px 0 0; }
.spec > div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13.5px; }
.spec > div:last-child { border-bottom: none; }
.spec dt { color: var(--ink-55); }
.spec dd { margin: 0; color: var(--ink); font-weight: 500; }

.datalink { margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.datalink span { color: var(--red); transition: transform .25s var(--ease); }
.datalink:hover span { transform: translate(2px, -2px); }

.taglist { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 0; }
.taglist li { font-size: 13px; color: var(--ink-70); padding: 6px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; }
.taglist li:last-child { border-bottom: none; }

/* ---------------- SERVICE-BENTO ---------------- */
.tile--serv { grid-column: span 4; }
.tile--serv-lg { grid-column: span 8; }
.serv__h { font-size: clamp(18px, 1.8vw, 23px); font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em; }
.serv__p { font-size: 14.5px; color: var(--ink-70); margin: 0; }
.serv__p + .serv__p { margin-top: 8px; }
.inline-tel { color: var(--red); text-decoration: none; font-weight: 600; }
.inline-tel:hover { text-decoration: underline; }

.tile--garanti { grid-column: span 8; grid-row: span 1; justify-content: center; }
.garanti__nums { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); margin: 0 0 18px; flex-wrap: wrap; }
.garanti__cell { display: flex; flex-direction: column; }
.garanti__n { font-size: clamp(38px, 5vw, 60px); font-weight: 600; line-height: 1; color: var(--ink); }
.garanti__u { font-size: 13px; color: var(--ink-55); letter-spacing: .04em; text-transform: uppercase; margin-top: 6px; }
.garanti__sep { width: 1px; align-self: stretch; background: var(--rule-strong); min-height: 54px; }
.garanti__line { font-size: 15px; color: var(--ink-70); margin: 0; max-width: 52ch; }

.tile--jour { grid-column: span 4; justify-content: center; }
.jour__h { font-size: clamp(20px, 2.2vw, 28px); font-weight: 800; margin: 0 0 10px; letter-spacing: -0.01em; }
.jour__tel { display: inline-block; font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; color: var(--red); text-decoration: none; margin: 0 0 10px; }
.jour__tel:hover { text-decoration: underline; }

.tile--orter { grid-column: span 4; padding: 0; overflow: hidden; min-height: 220px; }
.tile--orter img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.orter__overlay { position: relative; margin-top: auto; padding: var(--pad); width: 100%;
  background: linear-gradient(to top, rgba(47,56,60,.86), rgba(47,56,60,0)); color: #fff; }
.orter__eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.85); margin: 0 0 6px; }
.orter__line { font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; margin: 0; }

/* ---------------- BEGAGNAT-BENTO ---------------- */
.tile--used-photo { grid-column: span 6; grid-row: span 2; padding: 0; overflow: hidden; min-height: 320px; }
.tile--used-photo img { width: 100%; height: 100%; object-fit: cover; }
.tile--used-text { grid-column: span 6; justify-content: center; }
.used__h { font-size: clamp(26px, 3vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; line-height: 1.06; }
.used__lede { font-size: clamp(15px, 1.3vw, 18px); color: var(--ink-70); margin: 0 0 26px; max-width: 50ch; }
.tile--used-fig { grid-column: span 6; justify-content: center; gap: 18px; }
.usedfig__row { display: flex; align-items: baseline; gap: 14px; margin: 0; }
.usedfig__n { font-size: clamp(34px, 4vw, 52px); font-weight: 600; color: var(--ink); line-height: 1; }
.usedfig__u { font-size: 14px; color: var(--ink-55); letter-spacing: .03em; }
.usedfig__note { font-size: 13px; color: var(--ink-55); margin: 0; }

.bigbtn {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  background: var(--red); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 15px; padding: 13px 22px; border: none; border-radius: 3px;
  cursor: pointer; transition: transform .25s var(--ease), background .2s ease;
}
.bigbtn span { transition: transform .25s var(--ease); }
.bigbtn:hover { background: #8f1216; }
.bigbtn:hover span { transform: translateX(5px); }
.bigbtn--submit { margin-top: 6px; }

/* ---------------- KONTAKT-BENTO ----------------
   Layout som sluter tätt (inga stretch-tomrum):
   - Albin = porträttkolumn till höger, span 4 × 2 rader (porträttet fyller höjden)
   - Rad 1 vänster: Mats (span 4) + Kaffe (span 4)
   - Rad 2 vänster: Offert-formuläret (span 8) under dem
   Hela 12×2-rektangeln fylls; kaffe-plattan stretchas inte längre till ett tomrum. */
.bento--contact { grid-auto-rows: minmax(0, auto); }
.tile--person { grid-column: span 4; padding: 0; }
.tile--person-mats { grid-column: span 4; padding: var(--pad); justify-content: space-between; }
.tile--person-albin { grid-column: span 4; grid-row: span 2; }
.tile--person-albin .person__photo { flex: 1; aspect-ratio: auto; min-height: 240px; }
.person__role { font-size: 12px; letter-spacing: .06em; color: var(--red); margin: 0 0 8px; }
.person__name { font-size: clamp(20px, 2.2vw, 28px); font-weight: 800; margin: 0 0 12px; letter-spacing: -0.01em; }
.person__quote { font-size: clamp(16px, 1.5vw, 20px); font-style: italic; color: var(--ink-70); margin: 0 0 20px; }
.person__contacts { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.person__tel { font-size: clamp(17px, 1.6vw, 21px); font-weight: 600; color: var(--ink); text-decoration: none; }
.person__tel:hover { color: var(--red); }
.person__mail { font-size: 14px; color: var(--ink-55); text-decoration: none; }
.person__mail:hover { color: var(--red); }
.person__photo { aspect-ratio: 1 / 1; overflow: hidden; border-bottom: 1px solid var(--rule); background: var(--surface-2); }
.person__photo img { width: 100%; height: 100%; object-fit: cover; }
.person__pad { padding: var(--pad); display: flex; flex-direction: column; flex: 1; }
.tile--person-albin .person__contacts { margin-top: 14px; }

.tile--coffee { grid-column: span 4; justify-content: center; }
.coffee__line { font-size: clamp(18px, 1.9vw, 24px); font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }
.coffee__sub { font-size: 14.5px; color: var(--ink-70); margin: 0; }

.tile--offert { grid-column: span 8; gap: 12px; }
.offert__h { font-size: clamp(20px, 2.2vw, 28px); font-weight: 800; margin: 0 0 6px; letter-spacing: -0.01em; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: 13px; color: var(--ink-55); font-weight: 600; }
.field input {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--white);
  border: 1px solid var(--rule-strong); border-radius: 3px; padding: 11px 13px; min-height: 44px;
}
.field input:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; border-color: var(--red); }
.offert__note { font-size: 12px; color: var(--ink-40); margin: 4px 0 0; }

/* ---------------- FOOTER ---------------- */
.footer { padding-block: clamp(48px, 7vw, 88px) 32px; border-top: 1px solid var(--rule); }
.footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 48px); }
.footer__logo { height: 28px; width: auto; margin-bottom: 12px; }
.footer__tag { font-size: 12px; color: var(--ink-55); margin: 0; }
.footer__addr p { margin: 0 0 4px; font-size: 14px; color: var(--ink-70); }
.footer__addr a { color: var(--ink); text-decoration: none; font-size: 14px; }
.footer__addr a:hover { color: var(--red); }
.footer__city { color: var(--ink) !important; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 12px !important; margin-bottom: 8px !important; }
.footer__copy { margin: clamp(32px, 5vw, 56px) 0 0; font-size: 12px; color: var(--ink-40); }

/* ---------------- STICKY MOBIL-RINGLIST ---------------- */
.ringbar { display: none; }
@media (max-width: 767px) {
  .ringbar {
    display: grid; grid-template-columns: 1fr 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    background: #fff; border-top: 1px solid var(--rule-strong);
    box-shadow: 0 -6px 24px rgba(47,56,60,.10);
  }
  .ringbar__btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 10px 8px; text-decoration: none; color: var(--ink);
    border-right: 1px solid var(--rule);
  }
  .ringbar__btn:last-child { border-right: none; }
  .ringbar__btn--red { background: var(--red); color: #fff; }
  .ringbar__role { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
  .ringbar__num { font-size: 15px; font-weight: 600; }
  body { padding-bottom: 64px; }
}

/* ====================================================
   RESPONSIV BENTO-KOLLAPS — läslogisk ordning
   ==================================================== */
@media (max-width: 1024px) {
  .tile--lead { grid-column: span 12; grid-row: auto; }
  .tile--render { grid-column: span 6; grid-row: auto; min-height: 280px; }
  .tile--red, .tile--cta, .tile--need { grid-column: span 6; }
  .tile--prod-lg { grid-column: span 12; grid-row: auto; }
  .tile--product, .tile--prod-text { grid-column: span 6; }
  .tile--garanti, .tile--serv-lg { grid-column: span 12; }
  .tile--serv, .tile--jour, .tile--orter { grid-column: span 6; }
  .tile--used-photo { grid-column: span 12; grid-row: auto; min-height: 300px; }
  .tile--used-text, .tile--used-fig { grid-column: span 12; }
  .tile--person, .tile--coffee, .tile--offert { grid-column: span 6; }
  .tile--person-albin { grid-row: auto; }
  .tile--person-albin .person__photo { aspect-ratio: 1 / 1; flex: none; }
  .tile--offert { grid-column: span 12; }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
  /* allt en kolumn, läslogisk källordning bevaras */
  .tile, .tile--lead, .tile--render, .tile--red, .tile--cta, .tile--need,
  .tile--product, .tile--prod-lg, .tile--prod-text,
  .tile--serv, .tile--serv-lg, .tile--garanti, .tile--jour, .tile--orter,
  .tile--used-photo, .tile--used-text, .tile--used-fig,
  .tile--person, .tile--coffee, .tile--offert {
    grid-column: span 12 !important;
    grid-row: auto !important;
  }
  .tile--prod-lg { flex-direction: column; }
  .tile--prod-lg .tile__media { border-right: none; border-bottom: 1px solid var(--rule); aspect-ratio: 16/10; }
  .tile--render, .tile--used-photo, .tile--orter { min-height: 240px; }
  .garanti__nums { gap: 18px; }
  .footer__grid { grid-template-columns: 1fr; }
}

/* ====================================================
   REVEAL (GSAP sätter klassen; CSS-fallback om ingen JS)
   ==================================================== */
.js [data-tile] { opacity: 0; }
.js [data-tile].is-in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js [data-tile] { opacity: 1 !important; transform: none !important; }
  .tile[data-tile]:hover, a.tile[data-tile]:hover { transform: none !important; }
}
