/* =============================================================================
   Wikstad Bilservice AS
   1 Grunnlag   2 Knapper og ikoner   3 Header   4 Hero   5 Faktalinje
   6 Seksjoner  7 Tjenester           8 Om oss   9 Kontakt
   10 Footer   11 Bevegelse          12 404
   ========================================================================== */

/* --- 1 Grunnlag ----------------------------------------------------------- */
:root {
  --navy: #08151F;         /* logoens farge: hero, footer, knapper */
  --navy-2: #12273A;       /* hover og flater på mørk bunn */
  --ink: #0F1C27;          /* brødtekst */
  --muted: #56636F;
  --line: #DCE1E6;
  --line-strong: #C3CBD2;
  --tint: #F1F3F5;
  --white: #FFFFFF;
  --amber: #F2A900;        /* eneste aksent: hovedknapper og markører */
  --amber-hover: #FFBC2B;

  --f-head: 'Saira', 'Arial Narrow', system-ui, sans-serif;
  --f-body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r: 6px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(64px, 8vw, 112px);
  --header-h: 76px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
address { font-style: normal; }
figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--f-head);
  font-stretch: 112%;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: var(--navy);
  text-wrap: balance;
}
h1 { font-size: clamp(2.35rem, 1.3rem + 4vw, 4.25rem); line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 1.25rem + 2vw, 2.65rem); }
h3 { font-size: 1.32rem; font-weight: 600; font-stretch: 108%; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--r);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

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

.break { overflow-wrap: break-word; }

/* --- 2 Knapper og ikoner -------------------------------------------------- */
.ico { width: 20px; height: 20px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  border-radius: var(--r);
  font-family: var(--f-head);
  font-stretch: 106%;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn .ico { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }

.btn--amber { background: var(--amber); color: var(--navy); }
.btn--amber:hover { background: var(--amber-hover); }

.btn--navy { background: var(--navy); color: var(--white); }
.btn--navy:hover { background: var(--navy-2); }
.btn--navy .ico:last-child:not(:first-child) { transition: transform .2s; }
.btn--navy:hover .ico:last-child:not(:first-child) { transform: translateX(3px); }

.btn--ghost { border-color: rgba(255, 255, 255, .42); color: var(--white); }
.btn--ghost:hover { border-color: var(--white); background: rgba(255, 255, 255, .06); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
}
.icon-btn--navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.icon-btn .ico { width: 22px; height: 22px; }

/* --- 3 Header ------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(8, 21, 31, .45); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--header-h);
}
.header__logo { display: block; flex: none; }
.header__logo img { width: auto; height: 50px; }

.nav { display: flex; align-items: center; gap: 36px; }
.nav__list { display: flex; gap: 32px; }
.nav__link {
  position: relative;
  padding: 6px 0;
  font-family: var(--f-head);
  font-stretch: 106%;
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--navy);
  text-decoration: none;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__call { min-height: 44px; padding: 10px 18px; }

.header__mobile { display: none; gap: 8px; }
.ico--close { display: none; }

@media (max-width: 860px) {
  :root { --header-h: 64px; }
  .header__logo img { height: 40px; }
  .header__mobile { display: flex; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -24px rgba(8, 21, 31, .5);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__link { display: block; padding: 14px 0; font-size: 1.15rem; border-bottom: 1px solid var(--line); }
  .nav__link::after { display: none; }
  .nav__call { margin-top: 16px; }

  .header.menu-open .ico--open { display: none; }
  .header.menu-open .ico--close { display: block; }
}

/* --- 4 Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy);
  color: rgba(255, 255, 255, .84);
  padding-block: clamp(48px, 7vw, 96px) clamp(110px, 11vw, 150px);
}
.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero h1 { color: var(--white); text-wrap: wrap; }
.hero__lead {
  max-width: 36ch;
  margin: 22px 0 32px;
  font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem);
  line-height: 1.6;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__actions .btn { min-height: 54px; padding-inline: 24px; }

.hero__media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: 55% 50%;
  border-radius: var(--r);
}

/* Bilsilhuetten fra logoen, kjører inn fra høyre */
.hero__car {
  position: absolute;
  z-index: 0;
  left: -3%;
  bottom: clamp(70px, 7vw, 96px);
  width: min(1180px, 96%);
  height: auto;
  opacity: .08;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media img { aspect-ratio: 16 / 10; object-position: 60% 45%; }
  .hero__car { bottom: auto; top: 36%; width: 150%; left: -10%; }
}
@media (max-width: 480px) {
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__media img { aspect-ratio: 4 / 3; }
}

/* --- 5 Faktalinje (overlapper heroen) ------------------------------------- */
.facts-wrap { position: relative; z-index: 2; margin-top: calc(-1 * clamp(64px, 7vw, 92px)); }
.facts {
  display: grid;
  grid-template-columns: repeat(4, auto);
  background: var(--white);
  border-radius: var(--r);
  box-shadow: 0 24px 50px -30px rgba(8, 21, 31, .45), 0 0 0 1px rgba(8, 21, 31, .06);
}
.fact {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon label" "icon value";
  column-gap: 14px;
  align-items: center;
  padding: 24px clamp(16px, 1.8vw, 28px);
  position: relative;
}
.fact + .fact::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 1px;
  background: var(--line);
}
.fact__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--navy);
  flex: none;
}
.fact__icon .ico { width: 20px; height: 20px; }
.fact__label { grid-area: label; font-size: .9rem; color: var(--muted); line-height: 1.3; }
.fact__value {
  grid-area: value;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.fact__value--mail { overflow-wrap: normal; white-space: nowrap; }
a.fact__value:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }
@media (min-width: 1181px) { .fact { justify-content: center; } }

@media (max-width: 1180px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3)::before { display: none; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .facts { grid-template-columns: 1fr; }
  .fact { padding: 18px 20px; }
  .fact + .fact::before { display: none; }
  .fact + .fact { border-top: 1px solid var(--line); }
  .fact__value--mail { white-space: normal; overflow-wrap: break-word; }
}

/* --- 6 Seksjoner ---------------------------------------------------------- */
.section { padding-block: var(--section); }
.section--tint { background: var(--tint); }
.section__title { margin-bottom: clamp(28px, 3.5vw, 44px); max-width: 24ch; }
.section__cta { margin-top: clamp(32px, 4vw, 48px); }

/* --- 7 Tjenester ---------------------------------------------------------- */
.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 28px);
}
.service {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.service:hover { border-color: var(--line-strong); box-shadow: 0 18px 36px -28px rgba(8, 21, 31, .5); }
.service__media { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--tint); }
.service__media::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  background: var(--amber);
}
.service__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.service:hover .service__media img { transform: scale(1.03); }
.service__body { padding: 24px clamp(20px, 2vw, 28px) 28px; }
.service__body h3 { margin-bottom: 10px; }
.service__body p { margin: 0; color: var(--muted); }

@media (max-width: 960px) {
  .services { grid-template-columns: 1fr; }
  .service { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .service__media { aspect-ratio: auto; min-height: 200px; }
  .service__body { align-self: center; }
}
@media (max-width: 600px) {
  .service { display: flex; }
  .service__media { aspect-ratio: 16 / 10; min-height: 0; }
}

/* --- 8 Om oss ------------------------------------------------------------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.about__text p { max-width: 58ch; }
.about__text .btn { margin-top: 12px; }

.photo-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  background: var(--navy);
  overflow: hidden;
}
.photo-slot::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(255, 255, 255, .26);
  border-radius: 4px;
}
.photo-slot__car { width: 72%; opacity: .2; }
.photo-slot__text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  padding-inline: 24px;
  text-align: center;
  color: rgba(255, 255, 255, .78);
  font-size: .95rem;
}

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__media { order: 2; }
}

/* --- 9 Kontakt ----------------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.contact-list { display: grid; gap: 22px; margin-bottom: 32px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list__label { display: block; font-size: .9rem; color: var(--muted); line-height: 1.3; margin-bottom: 2px; }
.contact-list a, .contact-list address { font-weight: 600; color: var(--navy); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.map {
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--tint);
  border: 1px solid var(--line);
}
.map iframe { width: 100%; height: 100%; border: 0; }

.form {
  padding: clamp(22px, 3.5vw, 40px);
  background: var(--tint);
  border-radius: var(--r);
}
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .95rem; color: var(--navy); }
.field__opt { font-weight: 400; color: var(--muted); }
.field input,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(8, 21, 31, .14); }
.field.is-invalid input,
.field.is-invalid textarea { border-color: #B42318; box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.form__submit { width: 100%; min-height: 54px; margin-top: 4px; }
.form__status { margin: 14px 0 0; font-size: .95rem; color: var(--navy); }
.form__status:empty { display: none; }
.form__status.is-error { color: #B42318; }

@media (max-width: 900px) {
  .contact { grid-template-columns: 1fr; }
  .contact__info { display: contents; }
  .contact-list { order: 1; margin-bottom: 0; }
  .form { order: 2; }
  .map { order: 3; }
}
@media (max-width: 520px) {
  .form__row { grid-template-columns: 1fr; }
}

/* --- 10 Footer ------------------------------------------------------------ */
.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, .78);
  padding-top: clamp(48px, 6vw, 72px);
  font-size: 1rem;
}
.footer a { color: var(--white); text-decoration: none; }
.footer a:hover { text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 4px; }
.footer :focus-visible { outline-color: var(--amber); }
.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding-bottom: clamp(36px, 5vw, 56px);
}
.footer__logo img { width: 220px; height: auto; }
.footer__col { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.footer__title {
  margin-bottom: 6px;
  font-size: 1.05rem;
  font-weight: 600;
  font-stretch: 106%;
  color: var(--white);
}
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 22px 26px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .9rem;
  color: rgba(255, 255, 255, .62);
}
.footer__bottom p { margin: 0; }

@media (max-width: 760px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__logo { grid-column: 1 / -1; }
  .footer__logo img { width: 190px; }
}
@media (max-width: 480px) {
  .footer__top { grid-template-columns: 1fr; }
}

/* Fokus på mørk bunn */
.hero :focus-visible,
.icon-btn--navy:focus-visible { outline-color: var(--amber); }

/* --- 11 Bevegelse --------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero__car { animation: kjor-inn 1.8s cubic-bezier(.16, .8, .24, 1) .15s both; }
  .hero__text > * { animation: opp .8s cubic-bezier(.2, .7, .2, 1) both; }
  .hero__text > :nth-child(2) { animation-delay: .08s; }
  .hero__text > :nth-child(3) { animation-delay: .16s; }
  .hero__media { animation: opp 1s cubic-bezier(.2, .7, .2, 1) .12s both; }

  .js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js .services .reveal:nth-child(2) { transition-delay: .08s; }
  .js .services .reveal:nth-child(3) { transition-delay: .16s; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

@keyframes kjor-inn {
  from { clip-path: inset(0 0 0 100%); transform: translateX(4%); }
  to   { clip-path: inset(0 0 0 0); transform: none; }
}
@keyframes opp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* --- 12 404 --------------------------------------------------------------- */
.notfound {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px var(--gutter);
  background: var(--navy);
  color: rgba(255, 255, 255, .82);
  text-align: center;
}
.notfound__inner { max-width: 520px; }
.notfound img.notfound__logo { width: 200px; margin: 0 auto 40px; }
.notfound h1 { color: var(--white); font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); margin-bottom: 14px; }
.notfound p { margin-bottom: 28px; }
.notfound :focus-visible { outline-color: var(--amber); }
