/* ==========================================================================
   Skarvik AS — demo
   Tokens fra design-brief.md (farger fra eksisterende profil/logo)
   ========================================================================== */

:root {
  --red: #cb2229;
  --red-dark: #a61b21;
  --ink: #1d1d1d;
  --ink-soft: #2b2b2b;
  --body: #444444;
  --mist: #f4f4f4;
  --line: #e3e3e3;
  --white: #ffffff;

  --font-head: "Roboto Slab", "Georgia", serif;
  --font-body: "Roboto", "Segoe UI", Arial, sans-serif;

  --container: 1140px;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* Base ------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--white);
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

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

a {
  color: var(--red);
}

a:hover {
  color: var(--red-dark);
}

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

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

.section {
  padding: 76px 0;
}

.section--mist {
  background: var(--mist);
}

.section--ink {
  background: var(--ink);
}

.section-intro {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-intro p {
  margin-bottom: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--white);
  padding: 10px 18px;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
  color: var(--white);
}

/* Buttons ----------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
}

.btn--primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn--ghost:hover {
  background: var(--white);
  color: var(--ink);
}

.btn--outline {
  background: transparent;
  color: var(--red);
  border: 2px solid var(--red);
}

.btn--outline:hover {
  background: var(--red);
  color: var(--white);
}

/* Header ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.header-logo img {
  width: 165px;
  height: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius);
}

.site-nav a:hover {
  color: var(--red);
}

.site-nav a[aria-current="page"] {
  color: var(--red);
}

.site-nav .nav-phone a {
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  padding: 10px 18px;
  margin-left: 8px;
  white-space: nowrap;
}

.site-nav .nav-phone a:hover {
  background: var(--red-dark);
}

.header-phone {
  display: none;
  color: var(--red);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--ink);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 560px;
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 15, 15, 0.82) 0%, rgba(15, 15, 15, 0.35) 55%, rgba(15, 15, 15, 0.2) 100%);
}

.hero-content {
  position: relative;
  padding-top: 96px;
  padding-bottom: 64px;
  max-width: 760px;
}

.hero-content h1 {
  color: var(--white);
  margin-bottom: 0.4em;
}

.hero-content p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.15rem;
  max-width: 600px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

/* Page hero (undersider) --------------------------------------------------- */

.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 320px;
  background-size: cover;
  background-position: center;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 15, 15, 0.78), rgba(15, 15, 15, 0.25));
}

.page-hero .hero-content {
  padding-top: 64px;
  padding-bottom: 40px;
}

.page-hero h1 {
  color: var(--white);
  margin-bottom: 0;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0.6em 0 0;
  font-size: 1.1rem;
}

/* Service cards ------------------------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease;
}

.service-card:hover {
  box-shadow: var(--shadow);
}

.service-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.service-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.service-card-body h3 {
  margin-bottom: 0.4em;
}

.service-card-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.service-card-body h3 a:hover {
  color: var(--red);
}

.service-card-body p {
  margin-bottom: 1.2em;
  flex: 1;
}

.card-link {
  font-weight: 700;
  text-decoration: none;
}

.card-link::after {
  content: " →";
}

/* Spec / kapasitet (signatur) ----------------------------------------------- */

.section--ink h2,
.section--ink p {
  color: var(--white);
}

.section--ink .section-intro p {
  color: rgba(255, 255, 255, 0.8);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.spec-card {
  background: var(--ink-soft);
  border-top: 4px solid var(--red);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 26px 28px;
}

.spec-card h3 {
  color: var(--white);
  margin-bottom: 4px;
}

.spec-card .spec-sub {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.spec-card dl {
  margin: 0;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.18);
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec-row dt {
  color: rgba(255, 255, 255, 0.75);
}

.spec-row dd {
  margin: 0;
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

.spec-note {
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.8);
}

.spec-note p {
  margin: 0;
}

/* Referanser ---------------------------------------------------------------- */

.ref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: center;
}

.ref-grid .ref-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
}

.ref-grid img {
  max-height: 56px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.75;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.ref-item:hover img {
  filter: grayscale(0);
  opacity: 1;
}

/* Split (bilde + tekst) ------------------------------------------------------ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split img {
  border-radius: var(--radius);
  width: 100%;
  object-fit: cover;
}

.split h2 {
  margin-bottom: 0.6em;
}

.fact-list {
  list-style: none;
  margin: 20px 0 26px;
  padding: 0;
}

.fact-list li {
  padding: 7px 0 7px 30px;
  position: relative;
}

.fact-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 16px;
  height: 3px;
  background: var(--red);
}

/* CTA-stripe ------------------------------------------------------------------ */

.cta-band {
  background: var(--red);
  padding: 56px 0;
}

.cta-band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cta-band h2 {
  color: var(--white);
  margin: 0 0 0.2em;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.92);
  margin: 0;
  font-size: 1.1rem;
}

.cta-band .btn--ghost:hover {
  color: var(--red);
}

.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.cta-band .btn--white {
  background: var(--white);
  color: var(--red);
  border: 2px solid var(--white);
}

.cta-band .btn--white:hover {
  background: transparent;
  color: var(--white);
}

/* Tjenesteside ----------------------------------------------------------------- */

.service-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 56px;
  align-items: start;
}

.service-body h2 {
  font-size: 1.45rem;
  margin-top: 1.6em;
}

.service-body > h2:first-child {
  margin-top: 0;
}

.service-body .service-img {
  margin: 28px 0 8px;
  border-radius: var(--radius);
}

.service-aside {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 24px;
}

.aside-card {
  background: var(--mist);
  border-radius: var(--radius);
  padding: 24px 26px;
}

.aside-card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.8em;
}

.aside-card p {
  margin-bottom: 0.4em;
}

.aside-card .aside-role {
  color: var(--body);
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.aside-card a {
  font-weight: 500;
  text-decoration: none;
}

.aside-card a:hover {
  text-decoration: underline;
}

.aside-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aside-card li {
  padding: 5px 0;
}

.aside-card .btn {
  margin-top: 10px;
}

/* Kontaktside ---------------------------------------------------------------- */

.person-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.person-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.person-card h3 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.person-card .person-role {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.person-card p {
  margin: 0;
}

.person-card a {
  display: inline-block;
  padding: 2px 0;
  text-decoration: none;
  color: var(--body);
}

.person-card a:hover {
  color: var(--red);
}

.person-group {
  margin-bottom: 44px;
}

.person-group:last-child {
  margin-bottom: 0;
}

.person-group h2 {
  font-size: 1.3rem;
  margin-bottom: 18px;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.contact-info-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.contact-info-card h2 {
  font-size: 1.15rem;
  margin-bottom: 0.6em;
}

.contact-info-card p {
  margin-bottom: 0;
}

.contact-info-card a {
  text-decoration: none;
  font-weight: 500;
}

.contact-info-card a:hover {
  text-decoration: underline;
}

.contact-big {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Tidslinje -------------------------------------------------------------------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}

.timeline li {
  position: relative;
  padding: 0 0 26px 42px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--line);
}

.timeline .timeline-year {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}

/* Galleri ------------------------------------------------------------------------ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Footer --------------------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.8);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
}

.footer-col h2 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}

.footer-col h2 + ul + h2 {
  margin-top: 24px;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  padding: 4px 0;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-brand img:first-child {
  width: 160px;
}

.footer-brand p {
  margin: 18px 0;
}

.footer-dnv {
  width: 64px;
  border-radius: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 22px;
  padding-bottom: 22px;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Responsivt ------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .card-grid,
  .spec-grid,
  .person-grid,
  .contact-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ref-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .split,
  .service-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .service-aside {
    position: static;
  }

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

@media (max-width: 880px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 20px;
  }

  .site-nav a {
    padding: 13px 8px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .site-nav .nav-phone a {
    margin: 14px 0 0;
    text-align: center;
    border-bottom: 0;
    border-radius: var(--radius);
  }

  .header-phone,
  .nav-toggle {
    display: block;
  }

  .section {
    padding: 52px 0;
  }

  .hero {
    min-height: 480px;
  }
}

@media (max-width: 620px) {
  .card-grid,
  .spec-grid,
  .person-grid,
  .contact-info-grid {
    grid-template-columns: 1fr;
  }

  .ref-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .header-phone {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
