/*
Theme Name: Sirdal Entreprenørservice
Theme URI: https://sirdalent.no
Author: SF Digitalbyrå
Description: En luftig og animert landingsside for Sirdal Entreprenørservice AS.
Version: 1.4.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: sirdalent
*/

:root {
  --ink: #171915;
  --muted: #666a61;
  --paper: #f5f4ef;
  --panel: #ebe8de;
  --earth: #d8d0bd;
  --yellow: #f2b705;
  --yellow-soft: #ffd45a;
  --line: rgba(23, 25, 21, .14);
  --page-pad: clamp(1.25rem, 4.8vw, 5.5rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: .8rem 1rem;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform .2s ease;
}

.skip-link:focus { transform: translateY(0); }

.site-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 48% 66%, rgba(242, 183, 5, .08), transparent 22rem),
    var(--paper);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 5.9rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem var(--page-pad);
  border-bottom: 1px solid var(--line);
}

.brand,
.custom-logo-link {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand { gap: .9rem; }

.brand-mark {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  font-weight: 950;
  letter-spacing: -.08em;
  clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
  flex: 0 0 2.7rem;
}

.brand-name {
  max-width: none;
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: .085em;
  text-transform: uppercase;
  white-space: nowrap;
}

.custom-logo {
  display: block;
  width: auto;
  max-width: min(17rem, 44vw);
  height: 2.8rem;
  object-fit: contain;
}

.header-contact {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  font-size: .8rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
}

.header-contact::before {
  width: .52rem;
  height: .52rem;
  content: "";
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 .3rem rgba(242, 183, 5, .16);
}

.header-contact::after {
  position: absolute;
  right: 0;
  bottom: -.45rem;
  left: 1.2rem;
  height: 1px;
  content: "";
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .22s ease;
}

.header-contact:hover::after { transform: scaleX(1); transform-origin: left; }

.hero {
  display: grid;
  min-height: calc(100svh - 5.9rem);
  grid-template-areas:
    "copy aside"
    "work aside";
  grid-template-columns: minmax(0, 1.62fr) minmax(22.5rem, .78fr);
  grid-template-rows: auto minmax(18rem, 1fr);
  padding-left: var(--page-pad);
}

.hero-copy {
  grid-area: copy;
  max-width: 65rem;
  padding: clamp(3.2rem, 7vh, 6rem) clamp(2.5rem, 6vw, 7rem) clamp(1.5rem, 3vh, 2.6rem) 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 clamp(1.3rem, 2.7vh, 2rem);
  color: #796005;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 2.8rem;
  height: 2px;
  content: "";
  background: var(--yellow);
}

h1 {
  max-width: 10.5ch;
  margin: 0;
  font-size: clamp(4.5rem, 7.45vw, 8.8rem);
  font-weight: 920;
  line-height: .86;
  letter-spacing: -.07em;
  text-wrap: balance;
}

.hero-aside {
  position: relative;
  z-index: 5;
  grid-area: aside;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(3rem, 7vh, 6rem) var(--page-pad) clamp(2.5rem, 5vh, 4.5rem) clamp(2.2rem, 4.2vw, 4.8rem);
  border-left: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255,255,255,.38), transparent 54%),
    var(--panel);
}

.hero-aside::before {
  position: absolute;
  top: 0;
  left: -1px;
  width: 4px;
  height: clamp(4.5rem, 15vh, 9rem);
  content: "";
  background: var(--yellow);
}

.aside-label {
  margin: 0 0 1.15rem;
  color: #76786f;
  font-size: .73rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.intro {
  max-width: 31rem;
  margin: 0;
  color: #44483f;
  font-size: clamp(1.05rem, 1.35vw, 1.22rem);
  line-height: 1.7;
}

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: clamp(2rem, 4.5vh, 3.2rem) 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.services li {
  position: relative;
  padding: .85rem .6rem .85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .76rem;
  font-weight: 820;
  letter-spacing: .045em;
  line-height: 1.3;
  text-transform: uppercase;
}

.services li:nth-child(odd) { border-right: 1px solid var(--line); }

.services li::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: .3rem;
  height: .3rem;
  content: "";
  border-radius: 50%;
  background: var(--yellow);
  transform: translateY(-50%);
}

.contact-actions {
  display: grid;
  gap: .65rem;
  margin-top: clamp(2rem, 4.5vh, 3.2rem);
}

.contact-button {
  display: flex;
  min-width: 0;
  min-height: 4.25rem;
  align-items: center;
  gap: .85rem;
  padding: .95rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.42);
  font-size: clamp(.93rem, 1vw, 1.05rem);
  font-weight: 850;
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.contact-button:first-child {
  border-color: var(--yellow);
  background: var(--yellow);
}

.contact-button:hover {
  border-color: var(--ink);
  background: #fff;
  transform: translateY(-2px);
}

.contact-button svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.contact-button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.aside-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: clamp(2rem, 5vh, 4rem) 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: #74776d;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .105em;
  line-height: 1.4;
  text-transform: uppercase;
}

a[x-apple-data-detectors],
.org-number {
  color: inherit !important;
  font: inherit !important;
  text-decoration: none !important;
}

a[x-apple-data-detectors],
.org-number { pointer-events: none; }

.work-zone {
  position: relative;
  z-index: 2;
  grid-area: work;
  display: flex;
  min-height: 0;
  align-items: flex-start;
  justify-content: flex-start;
  margin-left: calc(var(--page-pad) * -1);
  padding: clamp(4.5rem, 8vh, 7rem) clamp(1rem, 4vw, 5rem) clamp(5rem, 8vh, 7rem) var(--page-pad);
  overflow: hidden;
  background: var(--paper);
}

.work-zone::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -2;
  height: 38%;
  content: "";
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.36) 55%, transparent),
    var(--earth);
  clip-path: polygon(0 33%, 15% 25%, 34% 39%, 54% 18%, 76% 31%, 100% 14%, 100% 100%, 0 100%);
}

.machine-actor {
  position: relative;
  width: min(46vw, 42rem);
  aspect-ratio: 1.5;
  flex: 0 0 auto;
  opacity: 0;
  transform: translate3d(60vw, 0, 0);
  filter: drop-shadow(0 1.5rem 1.15rem rgba(23,25,21,.14));
}

.is-ready .machine-actor { animation: machine-arrival 1.35s cubic-bezier(.16,.82,.24,1) .32s forwards; }

.excavator-sprite {
  position: absolute;
  inset: 0;
  background-image: var(--excavator-sprite);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 200% 200%;
  transform-origin: 68% 82%;
  transition: transform .18s ease;
}

.excavator-sprite[data-frame="1"] { background-position: 0 0; }
.excavator-sprite[data-frame="2"] { background-position: 100% 0; transform: rotate(-.12deg); }
.excavator-sprite[data-frame="3"] { background-position: 0 100%; transform: translateY(.15rem) rotate(.1deg); }
.excavator-sprite[data-frame="4"] { background-position: 100% 100%; transform: translateY(-.1rem) rotate(-.12deg); }

@keyframes machine-arrival {
  0% { opacity: 0; transform: translate3d(60vw, 0, 0); }
  68% { opacity: 1; transform: translate3d(-1.1rem, -.08rem, 0); }
  84% { transform: translate3d(.45rem, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}

.no-js .machine-actor { opacity: 1; transform: none; }

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 1.38fr) minmax(21rem, .82fr);
  }

  .hero-copy { padding-right: 2.5rem; }
  h1 { font-size: clamp(4rem, 7.8vw, 7.4rem); }
  .hero-aside { padding-left: 2.3rem; }
  .machine-actor { width: min(50vw, 34rem); }
}

@media (max-width: 860px) {
  .site-shell { overflow-x: hidden; overflow-y: auto; }

  .hero {
    grid-template-areas:
      "copy"
      "work"
      "aside";
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    padding-right: var(--page-pad);
  }

  .hero-copy { padding: clamp(3rem, 7vh, 5rem) 0 clamp(2.5rem, 5vh, 4rem); }

  h1 { max-width: 9ch; font-size: clamp(4.3rem, 13.5vw, 7rem); }

  .hero-aside {
    margin-right: calc(var(--page-pad) * -1);
    margin-left: calc(var(--page-pad) * -1);
    padding: clamp(2.5rem, 6vh, 4rem) var(--page-pad);
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .hero-aside::before {
    display: none;
  }

  .intro { max-width: 40rem; }
  .services { max-width: 40rem; }
  .contact-actions { max-width: 40rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aside-meta { max-width: 40rem; }

  .work-zone {
    justify-content: flex-end;
    margin-right: calc(var(--page-pad) * -1);
    padding: 0 0 clamp(3.8rem, 9vw, 5rem);
    overflow: visible;
  }

  .machine-actor {
    width: min(79vw, 43rem);
    margin-top: clamp(-3rem, -6vw, -2rem);
    margin-right: -3vw;
  }
}

@media (max-width: 600px) {
  .site-header { min-height: 4.8rem; padding-top: 1rem; padding-bottom: 1rem; }
  .brand-mark { width: 2.35rem; height: 2.35rem; }
  .brand-name { max-width: 11.6rem; font-size: .66rem; }
  .brand-name { white-space: normal; }
  .custom-logo { max-width: 10.5rem; height: 2.35rem; }
  .header-contact { gap: .55rem; font-size: .67rem; letter-spacing: .07em; }
  .header-contact::before { width: .42rem; height: .42rem; box-shadow: 0 0 0 .22rem rgba(242,183,5,.16); }
  .hero { min-height: calc(100svh - 4.8rem); grid-template-rows: auto auto auto; }
  .hero-copy { padding-top: 2.8rem; padding-bottom: 2.6rem; }
  .eyebrow { margin-bottom: 1.15rem; font-size: .67rem; }
  h1 { font-size: clamp(3.35rem, 14vw, 4.8rem); }
  .hero-aside { padding-top: 2.4rem; padding-bottom: 2.5rem; }
  .aside-label { margin-bottom: .9rem; font-size: .67rem; }
  .intro { font-size: 1rem; line-height: 1.58; }
  .services { margin-top: 1.65rem; }
  .services li { padding-top: .72rem; padding-bottom: .72rem; font-size: .68rem; }
  .contact-actions { grid-template-columns: 1fr; margin-top: 1.8rem; }
  .contact-button { min-height: 3.65rem; font-size: .92rem; }
  .aside-meta { margin-top: 1.8rem; }
  .work-zone { padding-bottom: 3.7rem; }
  .machine-actor { width: 96vw; margin-right: -2vw; }
}

@media (max-width: 390px) {
  .brand-name { max-width: 10.8rem; font-size: .62rem; }
  .header-contact { font-size: .62rem; }
  h1 { font-size: 3.42rem; }
  .services { grid-template-columns: 1fr; }
  .services li:nth-child(odd) { border-right: 0; }
  .aside-meta { display: block; }
  .aside-meta span { display: block; }
  .aside-meta span + span { margin-top: .4rem; }
}

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

  .machine-actor { opacity: 1; transform: none; }
  .excavator-sprite { background-position: 100% 100%; }
}
