/* ============ Base ============ */
:root {
  --black: #000;
  --white: #fff;
  --accent: #ff4d00;
  --max-width: 1080px;
  --header-height: 72px;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: var(--header-height);
}

h1, h2 {
  font-family: "Bebas Neue", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

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

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

::selection {
  background: var(--accent);
  color: var(--black);
}

/* ============ Header ============ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--black);
  transition: transform 0.4s ease;
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.logo img {
  height: 52px;
  width: auto;
}

/* ============ Sections ============ */
.section {
  padding: 96px 0;
  background: #fafafa;
}

main > .section:first-of-type {
  padding-top: 48px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 40px;
  text-align: center;
}

h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 5px;
  margin: 8px auto 0;
  background: var(--accent);
}

.js h2::after {
  transform: scaleX(0);
  transition: transform 0.5s ease 0.1s;
}

.js h2.is-visible::after {
  transform: scaleX(1);
}

/* ============ Scroll reveal ============ */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js h2::after,
  .js #om h1::after {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============ Every other section slightly darker ============ */
#installation,
#forsaljning,
#kontakt {
  background: #f5f5f5;
}

/* ============ Om ============ */
#om .container {
  border: 2px solid var(--black);
  box-shadow: 16px 16px 0 0 var(--black);
  background: var(--white);
  padding: 48px 24px;
}

.om-content {
  display: flex;
  align-items: center;
  gap: 48px;
}

.om-text {
  flex: 1;
  min-width: 0;
}

.om-text p + p {
  margin-top: 1.25em;
}

#om h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

#om h1::after {
  content: "";
  display: block;
  width: 72px;
  height: 5px;
  margin-top: 12px;
  background: var(--accent);
}

.js #om h1::after {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s ease 0.1s;
}

.js #om h1.is-visible::after {
  transform: scaleX(1);
}

.om-services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.om-services a {
  position: relative;
  z-index: 0;
  display: inline-block;
  border: 2px solid var(--black);
  box-shadow: 4px 4px 0 0 var(--black);
  padding: 6px 14px;
  font-size: 0.95rem;
  font-weight: 700;
}

.om-services a::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.15s ease;
}

.om-services a:hover::before,
.om-services a:focus-visible::before {
  transform: scaleX(1);
}

/* ============ Subsection cards ============ */
.slide {
  margin: 0 16px 14px 16px;
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 32px;
  border: 1px solid var(--black);
  background: var(--white);
  box-shadow: 6px 6px 0 0 var(--black);
}

.slide-illustration {
  flex: 0 0 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-illustration svg,
.slide-illustration img {
  width: 100%;
  height: 100%;
}

.slide-text {
  flex: 1;
  min-width: 0;
}

.slide-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ============ Kundcase ============ */
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 0 16px 14px 16px;
}

.case-card {
  border: 1px solid var(--black);
  background: var(--white);
  box-shadow: 6px 6px 0 0 var(--black);
  padding: 24px;
}

.case-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.case-card p {
  font-size: 0.95rem;
}

/* ============ Kontakt ============ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
  max-width: 640px;
  margin: 0 auto;
}

.contact-generic {
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}

.contact-generic a {
  position: relative;
  display: inline-block;
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-generic a:hover,
.contact-generic a:focus-visible {
  border-bottom-color: var(--accent);
}

/* With JS the email starts black and wipes to orange left to right when the
   contact block scrolls into view; without JS it is simply orange. Once the
   wipe finishes (0.15s delay + 0.5s) the base text turns transparent so the
   two stacked text layers never blend, which avoids fringed glyph edges. */
.js .contact-generic a {
  color: var(--black);
  transition: border-color 0.2s ease, color 0s linear 0.65s;
}

.js .contact-generic.is-visible a {
  color: transparent;
}

.js .contact-generic a::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--accent);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.5s ease 0.15s;
}

.js .contact-generic.is-visible a::after {
  clip-path: inset(0 0 0 0);
}

.contact-card {
  text-align: center;
  padding: 32px 24px;
  border: 1px solid var(--black);
  background: var(--white);
  box-shadow: 6px 6px 0 0 var(--black);
}

.portrait {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--black);
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.portrait svg,
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.contact-role {
  font-size: 0.95rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-info {
  list-style: none;
}

.contact-info li {
  margin-top: 4px;
}

.contact-info a {
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.contact-info a:hover,
.contact-info a:focus-visible {
  border-bottom-color: var(--accent);
}

/* ============ Footer ============ */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding: 64px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
}

.footer-logo {
  width: 160px;
  height: auto;
}

.footer-info {
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-name {
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ============ Section intro ============ */
.section-intro {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

/* ============ Large screens ============ */
@media (min-width: 1024px) {
  .portrait {
    width: 240px;
    height: 240px;
  }
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .section {
    padding: 64px 0;
  }

  main > .section:first-of-type {
    padding-top: 32px;
  }

  .logo img {
    height: 40px;
  }

  h2 {
    font-size: 1.6rem;
    margin-bottom: 28px;
  }

  .slide {
    flex-direction: column;
    gap: 24px;
    padding: 20px;
  }

  .slide-illustration {
    flex: 0 0 auto;
    width: 100%;
    max-width: 240px;
    height: 200px;
  }

  .case-grid {
    grid-template-columns: 1fr;
  }

  .om-content {
    flex-direction: column;
    gap: 24px;
  }

  #om .container {
    margin: 0 16px;
    box-shadow: 8px 8px 0 0 var(--black);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .section-intro {
    margin-bottom: 28px;
  }

  .footer-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 32px;
  }

  .footer-logo {
    width: 120px;
  }
}
