/* BEST forside, prototype. Logo og fargekoder fra dagens bestgroup.no, brukt med lett hånd. */
:root {
  --white: #ffffff;
  --soft: #f6f6f3;
  --line: #e4e4df;
  --rule: #dcdcd6;
  --text: #24272b;
  --body: #4a4e55;
  --muted: #676b72;
  --faint: #b9bcc1;   /* kun til dekorative understrekinger */

  /* Logoens to ruter: kun små signaler */
  --red: #e03a3e;
  --green: #008348;

  /* Målgruppefarger fra dagens nettside, og like svake toner av dem */
  --seg-blue: #00aae6;
  --seg-green: #007a3e;
  --seg-amber: #f0aa00;
  --tint-blue: #f0f8fc;
  --tint-green: #f0f6f2;
  --tint-amber: #fbf7ee;

  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "Barlow Condensed", "Arial Narrow", sans-serif; /* nærmest dagens Proxima Nova Condensed */
  --wrap: 1320px;
  --gutter: clamp(20px, 5vw, 64px);
  --section: clamp(80px, 9vw, 144px);
  --header-h: 76px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.03rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { color: var(--text); text-wrap: balance; }
p { text-wrap: pretty; }
sup { font-size: .55em; line-height: 0; vertical-align: super; margin-left: .04em; }
:focus-visible { outline: 1.5px solid var(--text); outline-offset: 4px; border-radius: 2px; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--text); color: #fff; padding: 10px 16px; text-decoration: none; border-radius: 2px;
}
.skip:focus { top: 12px; }

/* Signalruten: én størrelse, samme hjørneradius som rutene i logoen (ca. 13 %) */
.sq { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 13%; background: var(--sq, currentColor); transition: background-color .5s ease; }
.sq--red { --sq: var(--red); }
.sq--green { --sq: var(--green); }

/* Liten etikett i smale versaler, som menyen på dagens nettside */
.label {
  margin: 0 0 14px;
  font: 500 .8rem/1 var(--font-label);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Knapper og lenker ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid var(--text); border-radius: 2px;
  background: transparent; color: var(--text);
  font: 500 .95rem/1 var(--font); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.btn:hover { background: var(--text); color: #fff; }
.btn::after, .segment__arrow, .index a::after {
  content: ""; width: 14px; height: 14px; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 8h13M9 3l5 5-5 5' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 8h13M9 3l5 5-5 5' fill='none' stroke='black' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .25s ease;
}
.btn:hover::after, .segment a:hover .segment__arrow, .index a:hover::after { transform: translateX(3px); }
.link {
  color: var(--text); font-weight: 500;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px;
  text-decoration-color: var(--faint);
  transition: text-decoration-color .2s ease;
}
.link:hover { text-decoration-color: var(--text); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header__inner { height: 100%; display: flex; align-items: center; gap: 56px; }
.brand { display: block; flex: none; }
.brand img { display: block; width: 46px; height: auto; }
.nav { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 32px; }
.nav__list { display: flex; gap: clamp(18px, 2.2vw, 34px); list-style: none; margin: 0; padding: 0; }
.nav__list a, .nav__docs {
  font-size: .925rem; font-weight: 400; color: var(--body); text-decoration: none;
  padding: 6px 0; border-bottom: 1px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.nav__list a:hover, .nav__docs:hover { color: var(--text); border-color: var(--text); }
.nav__docs { display: inline-block; }
.nav__docs svg { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn {
  display: none; margin-left: auto; align-items: center; gap: 10px;
  background: none; border: 0; padding: 8px 0; color: var(--text);
  font: 500 .95rem/1 var(--font); cursor: pointer;
}
.menu-btn__icon { width: 18px; height: 8px; border-block: 1.5px solid currentColor; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(560px, calc(100svh - var(--header-h)), 760px);
  display: flex; align-items: center;
}
.hero__content { width: 100%; max-width: var(--wrap); margin-inline: auto; padding: 72px var(--gutter); }
.hero__media { position: absolute; top: 0; right: 0; bottom: 0; width: 52%; background: var(--soft); }
.hero__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 95% 40%; }
.hero__title {
  margin: 0 0 36px;
  font-size: clamp(2.9rem, 5.6vw, 5.6rem);
  font-weight: 300; line-height: 1.03; letter-spacing: -.035em;
}
.key { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 8px; font-size: .97rem; color: var(--body); }
.key li { display: flex; align-items: center; gap: 12px; }
.hero__lead { margin: 0 0 40px; font-size: 1.08rem; color: var(--muted); }
.hero__lead, .key { max-width: min(28em, calc(44vw - var(--gutter) - 24px)); }
.hero__actions { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }

/* ---------- Seksjoner ---------- */
.segments, .signal, .products, .news, .refs, .about, .contact { padding-block: var(--section); }
.h2 { margin: 0; font-size: clamp(1.9rem, 3.2vw, 3rem); font-weight: 300; line-height: 1.12; letter-spacing: -.025em; }
.section-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 18px;
  align-items: last baseline; margin-bottom: clamp(40px, 5vw, 64px);
}
.section-head > div { grid-column: 1 / span 6; }
.section-head__text { grid-column: 8 / span 5; margin: 0; color: var(--muted); }
.section-head--row { display: flex; justify-content: space-between; align-items: last baseline; gap: 24px; flex-wrap: wrap; }

/* Målgrupper */
.segments__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.segment { display: flex; }
.segment a {
  display: flex; flex-direction: column; width: 100%;
  min-height: 270px; padding: 34px 32px 30px;
  background: var(--tint); border-radius: 2px;
  text-decoration: none;
  transition: background-color .3s ease;
}
.segment a:hover { background: var(--tint-hover); }
.segment .sq { --sq: var(--seg); margin-bottom: 28px; }
.segment--blue { --seg: var(--seg-blue); --tint: var(--tint-blue); --tint-hover: #e6f4fa; }
.segment--green { --seg: var(--seg-green); --tint: var(--tint-green); --tint-hover: #e6f0ea; }
.segment--amber { --seg: var(--seg-amber); --tint: var(--tint-amber); --tint-hover: #f8f1e1; }
.segment__title { margin: 0 0 12px; font-size: 1.35rem; font-weight: 500; line-height: 1.25; letter-spacing: -.01em; }
.segment p { margin: 0 0 28px; color: var(--body); }
.segment__arrow { display: block; margin-top: auto; color: var(--text); }

/* Slik blir rødt til grønt */
.signal { background: var(--soft); }
.signal__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.signal__copy { grid-column: 1 / span 6; }
.signal__intro { margin: 20px 0 56px; max-width: 31em; font-size: 1.08rem; color: var(--muted); }
.steps { position: relative; padding-left: 40px; --y: 12px; }
.steps__list { list-style: none; margin: 0; padding: 0; }
.step { padding-bottom: 40px; }
.step:last-child { padding-bottom: 0; }
.step__title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 500; line-height: 1.3; color: var(--muted); transition: color .4s ease; }
.step p { margin: 0; max-width: 33em; color: var(--muted); transition: color .4s ease; }
.step.is-active .step__title, .step.is-done .step__title { color: var(--text); }
.step.is-active p { color: var(--body); }
.steps__track { position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.steps__dot {
  position: absolute; left: -5px; top: var(--y);
  width: 10px; height: 10px; border-radius: 13%;
  transform: translateY(-50%);
  background: var(--red);
  transition: top .6s cubic-bezier(.2, .7, .2, 1), background-color .5s ease;
}
.steps.is-green .steps__dot { background: var(--green); }

.signal__media { grid-column: 8 / span 5; position: sticky; top: calc(var(--header-h) + 48px); margin: 0; }
.signal__media img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
.status {
  position: absolute; left: -28px; bottom: 36px;
  display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 14px;
  min-width: 220px; padding: 14px 20px 14px 18px;
  background: var(--white); border: 1px solid var(--line); border-radius: 2px;
  box-shadow: 0 14px 34px rgba(36, 39, 43, .07);
  font-size: .9rem; line-height: 1.4;
}
.status__sq { grid-row: span 2; }
.status__room { color: var(--text); font-weight: 500; }
.status__state { color: var(--muted); }
.status.is-green .status__sq { --sq: var(--green); }

/* Produkter */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index a {
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 16px;
  align-items: baseline; gap: 32px;
  padding: 24px 0; border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.index a::after { align-self: center; color: var(--muted); }
.index a:hover::after { color: var(--text); }
.index__name { font-size: 1.25rem; font-weight: 500; color: var(--text); letter-spacing: -.01em; }
.index__desc { color: var(--muted); }

/* Nyheter */
.news { border-top: 1px solid var(--line); }
.news__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.post a { display: block; text-decoration: none; }
.post__img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--soft); border-radius: 2px; }
.post__img img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--x, 50%) var(--y, 50%);
  filter: grayscale(1) contrast(.88) brightness(var(--b, 1.06));
  transition: transform .6s ease;
}
.post a:hover .post__img img { transform: scale(1.025); }
.post__meta { display: flex; align-items: center; gap: 10px; margin: 20px 0 8px; font-size: .8rem; color: var(--muted); }
.post__meta .sq { --sq: var(--seg); }
.post__title { margin: 0 0 8px; min-height: calc(2 * 1.35em); font-size: 1.15rem; font-weight: 500; line-height: 1.35; }
.post a:hover .post__title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.post__text { margin: 0; font-size: .97rem; color: var(--muted); }

/* Referanser */
.refs { background: var(--soft); }
.refs__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.refs__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.ref__name { font-size: clamp(1.35rem, 2.3vw, 1.9rem); font-weight: 300; line-height: 1.2; letter-spacing: -.02em; color: var(--text); }
.ref__place { color: var(--muted); font-size: .95rem; white-space: nowrap; }

/* Om BEST */
.about__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; align-items: center; }
.about__img { grid-column: 1 / span 6; display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 2px; }
.about__text { grid-column: 8 / span 5; }
.about__text .h2 { margin-bottom: 28px; }
.about__text p { margin: 0 0 1em; }
.about__text .label { margin-bottom: 14px; }

/* Kontakt */
.contact { background: var(--soft); }
.offices { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.offices li { border-top: 1px solid var(--line); padding-top: 24px; }
.offices h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 500; }
.offices p { margin: 0 0 14px; color: var(--muted); }
.offices a { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; text-decoration: none; border-bottom: 1px solid var(--faint); }
.offices a:hover { border-color: var(--text); }

/* Footer */
.footer { background: var(--soft); padding-block: 0 40px; font-size: .9rem; color: var(--muted); }
.footer__inner { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.footer__logo { width: 36px; height: auto; }
.footer__name { margin: 0; color: var(--text); font-weight: 500; }
.footer__name span { margin-left: 12px; font-weight: 400; color: var(--muted); }
.footer__links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.footer__copy { margin: 0 0 0 auto; }

/* ---------- Responsivt ---------- */
@media (max-width: 1120px) {
  .menu-btn { display: inline-flex; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white);
    padding: 8px var(--gutter) 28px;
    border-bottom: 1px solid var(--line);
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .nav[data-open="true"] { visibility: visible; opacity: 1; transform: none; transition: opacity .2s ease, transform .2s ease; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__list a, .nav__docs { display: block; padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid var(--line); }
  .nav__docs { margin-top: 8px; border: 0; }
}

@media (max-width: 960px) {
  .section-head > div, .section-head__text { grid-column: 1 / -1; }
  .signal__copy { grid-column: 1 / -1; }
  .signal__media { grid-column: 1 / -1; position: relative; top: auto; margin-top: 56px; }
  .signal__media img { aspect-ratio: 4 / 3; }
  .status { left: 16px; bottom: 16px; }
  .news__list { grid-template-columns: 1fr; gap: 0; }
  .post { border-top: 1px solid var(--line); padding: 24px 0; }
  .post a { display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .post__img { grid-row: span 3; aspect-ratio: 1; }
  .post__meta { margin: 0 0 6px; }
  .post__title { margin: 0 0 6px; min-height: 0; font-size: 1.05rem; }
  .post__text { font-size: .95rem; }
  .about__img, .about__text { grid-column: 1 / -1; }
  .index a { grid-template-columns: minmax(0, 1fr) 16px; gap: 4px 20px; }
  .index__name, .index__desc { grid-column: 1; }
  .index a::after { grid-column: 2; grid-row: 1 / span 2; }
  .segments__list { gap: 16px; }
  .segment a { padding: 28px 24px 24px; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .brand img { width: 40px; }
  /* Fotoet øverst og teksten under */
  .hero { flex-direction: column; align-items: stretch; min-height: 0; }
  .hero__media { order: -1; position: relative; width: 100%; aspect-ratio: 4 / 3; }
  .hero__media img { object-position: 100% 40%; }
  .hero__content { padding: 32px var(--gutter) 56px; }
  .hero__title { margin-bottom: 24px; }
  .hero__lead, .key { max-width: none; }
  .segments__list { grid-template-columns: 1fr; }
  .segment a { min-height: 0; }
  .segment .sq { margin-bottom: 18px; }
  .offices { grid-template-columns: 1fr; gap: 0; }
  .offices li { padding-block: 22px; }
  .refs__list li { flex-direction: column; gap: 2px; }
  .footer__copy { margin-left: 0; width: 100%; }
  .footer__name span { display: block; margin: 4px 0 0; }
}

@media (max-width: 520px) {
  .post a { grid-template-columns: 112px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
