:root {
  --bg: #f3eee5;
  --card: rgba(255, 249, 242, 0.86);
  --text: #26211d;
  --text-soft: #5f564d;
  --text-light: #f5f1e8;
  --line: rgba(38, 33, 29, 0.1);
  --line-strong: rgba(38, 33, 29, 0.18);
  --accent: #b98652;
  --accent-deep: #965f30;
  --forest: #2d4743;
  --shadow: 0 24px 60px rgba(38, 33, 29, 0.12);
  --radius-xl: 32px;
  --content-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Clears the sticky nav pill (12px offset + pill height + breathing room). */
  scroll-padding-top: 88px;
  /* Decorative bleeds (e.g. .section-alt::before) extend past the viewport on
     narrow screens; clip them instead of exposing horizontal scroll. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI Variable", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(185, 134, 82, 0.18), transparent 28%),
    radial-gradient(circle at right 18%, rgba(45, 71, 67, 0.12), transparent 26%),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 52%, #efe3d1 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.34), transparent 85%);
  pointer-events: none;
  z-index: -1;
}

.site-shell {
  width: min(calc(100% - 32px), var(--content-width));
  margin: 0 auto;
  padding: 20px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  min-height: 214px;
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 248, 239, 0.14), rgba(255, 248, 239, 0.14)),
    url("media/header-bg-0101.jpg") 48% 33% / cover no-repeat;
  box-shadow: var(--shadow);
}

.brand,
.nav a,
.button,
.card-link {
  text-decoration: none;
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0 auto;
  width: fit-content;
  max-width: min(100%, 296px);
  padding: 7px 11px;
  border-radius: 24px;
  color: var(--text);
  min-width: 0;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 239, 229, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(38, 33, 29, 0.05);
}

.brand::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.brand-logo {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border-radius: 18px;
  mix-blend-mode: multiply;
}

.nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 18px;
  padding: 8px 10px;
  border-radius: 22px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  background: rgba(255, 248, 239, 0.72);
  box-shadow: 0 14px 32px rgba(38, 33, 29, 0.08);
}

.nav a {
  color: var(--text);
  font-size: 0.98rem;
  padding: 9px 14px;
  border-radius: 16px;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--forest);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
  outline: none;
}

/* Quiet phone-only call chip in the sticky nav; hidden on larger viewports
   where the contact section carries the number. */
.nav-call {
  display: none;
  border: 1px solid var(--line-strong);
}

.hero,
.section,
.footer {
  animation: rise 700ms ease both;
}

.frontpage-stage {
  position: relative;
  margin-top: 22px;
  padding: 32px clamp(18px, 4vw, 34px);
  min-height: 760px;
  border-radius: 42px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow);
}

.frontpage-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.52) 0%, rgba(243, 238, 229, 0.72) 100%),
    radial-gradient(circle at 78% 20%, rgba(45, 71, 67, 0.10), transparent 26%),
    radial-gradient(circle at 20% 18%, rgba(185, 134, 82, 0.12), transparent 24%);
  z-index: -2;
}

.frontpage-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(185, 134, 82, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.08));
  z-index: -1;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  align-items: start;
  /* The stage's own padding provides the top edge, keeping it equal to the
     bottom edge below the intro band. */
  padding: 0 0 32px;
}

.hero-copy {
  max-width: 720px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 34px;
  background: rgba(251, 246, 238, 0.70);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 46px rgba(38, 33, 29, 0.10);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 700;
  line-height: 1.04;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.7rem, 5.2vw, 4.7rem);
}

h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 3vw, 3.2rem);
}

h3 {
  font-size: 1.42rem;
}

.lead,
.section-intro,
.service-card p,
.process-card p,
.timeline-step p,
.split-copy p,
.contact-card p,
.footer p,
.hero-panel-card p,
.hero-panel-card li,
.gallery-tile p {
  line-height: 1.7;
}

.lead {
  max-width: 58ch;
  margin: 24px 0 0;
  color: var(--text-soft);
  font-size: 1.08rem;
}

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

.hero-copy-visual {
  margin-top: 26px;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 18px 36px rgba(38, 33, 29, 0.10);
}

.hero-copy-visual-image {
  display: block;
  width: 100%;
  min-height: 240px;
  max-height: 320px;
  object-fit: cover;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 18px;
  font-weight: 700;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.button:hover,
.card-link:hover {
  transform: translateY(-2px);
}

/* Touch feedback: hover lifts do not exist on touch, a slight press does. */
.button:active,
.card-link:active,
.nav a:active,
.contact-item:active,
.contact-chip:active {
  transform: translateY(1px);
}

.button-primary {
  color: var(--text-light);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 18px 28px rgba(150, 95, 48, 0.24);
}

.button-secondary {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
}

.hero-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.hero-visual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: 360px;
  padding: 10px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: var(--shadow);
  background: rgba(255, 248, 239, 0.24);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.hero-visual-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 340px;
  border-radius: calc(var(--radius-xl) - 8px);
  object-fit: cover;
}

.hero-panel-card,
.service-card,
.process-card,
.timeline-step,
.image-collage,
.gallery-tile,
.contact-card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-panel-card {
  padding: 28px;
}

.hero-panel-dark {
  color: var(--text-light);
  background: linear-gradient(165deg, rgba(29, 42, 39, 0.96), rgba(57, 82, 78, 0.96));
  margin-top: 4px;
}

.panel-label {
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-panel-card ul {
  margin: 0;
  padding-left: 18px;
}

.intro-band {
  max-width: 84ch;
  margin: 0 auto;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 26px;
  background: rgba(255, 251, 246, 0.80);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.intro-band p {
  margin: 0;
  color: var(--forest);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.section {
  /* Fluid rhythm: the whitespace-to-viewport ratio stays calm on every tier. */
  padding: clamp(72px, 9vw, 96px) 0 0;
}

.section-alt {
  position: relative;
}

.section-alt::before {
  content: "";
  position: absolute;
  /* Bleed 24px past the content column, but never past the viewport edge:
     (100% - 100vw) / 2 is the negative of the shell's side margin. iOS Safari
     widens the layout viewport on any real overflow (root overflow-x is not
     reliably honored for touch panning), so the bleed must be exact. */
  inset: 58px max(-24px, calc((100% - 100vw) / 2)) -18px;
  border-radius: 46px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.12));
  z-index: -1;
}

.section-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}

#omrader .section-heading h2,
#arbeidsmate .section-heading h2,
#arbeid .section-heading h2 {
  max-width: none;
  white-space: nowrap;
}

#skog h2,
#handverk h2 {
  max-width: 15ch;
}

#kontakt h2 {
  max-width: 18ch;
}

#hvorfor .section-heading h2 {
  max-width: 26ch;
}

.section-intro {
  max-width: 66ch;
  margin: 0 0 28px;
  color: var(--text-soft);
}

.why-top {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
}

.why-copy .section-heading {
  margin-bottom: 18px;
}

.why-copy .section-intro {
  margin-bottom: 0;
}

.why-visual {
  margin: 0;
  min-height: 320px;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  box-shadow: var(--shadow);
  background: rgba(255, 250, 243, 0.56);
}

.why-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.service-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.card-subtitle {
  margin: -2px 0 0;
  color: var(--text-soft);
  font-size: 0.96rem;
  font-weight: 600;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--accent-deep);
  font-weight: 700;
  transition: transform 180ms ease;
}

.card-link::after {
  content: "->";
  /* Alt-text form hides the decorative arrow from screen readers where supported. */
  content: "->" / "";
}

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

.process-card {
  padding: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.74);
}

.timeline {
  display: grid;
  gap: 18px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  padding: 26px;
  border: 1px solid var(--line);
  background: rgba(255, 249, 242, 0.8);
}

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

.split-copy p + p {
  margin-top: 14px;
}

.check-list {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 24px 0 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.65;
}

.check-list li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(185, 134, 82, 0.14);
}

.gallery-entry {
  display: grid;
  gap: 12px;
}

.gallery-tile {
  min-height: 340px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at top left, rgba(185, 134, 82, 0.2), transparent 28%),
    linear-gradient(165deg, rgba(45, 71, 67, 0.14), rgba(255, 250, 243, 0.8));
}

.gallery-media {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 312px;
  overflow: hidden;
  border-radius: 24px;
}

.gallery-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-caption {
  margin: 0;
  color: var(--forest);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.3rem;
  text-align: center;
}

.image-collage {
  position: relative;
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  justify-items: center;
  align-items: stretch;
  gap: 12px;
  padding: 14px;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at top left, rgba(185, 134, 82, 0.16), transparent 32%),
    linear-gradient(165deg, rgba(45, 71, 67, 0.12), rgba(255, 250, 243, 0.88));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.image-collage::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 24px;
}

.image-collage > * {
  position: relative;
  z-index: 1;
}

.collage-card {
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 14px 28px rgba(38, 33, 29, 0.10);
}

.collage-card-main {
  min-height: 312px;
}

.collage-stack {
  display: grid;
  gap: 12px;
}

.collage-stack .collage-card {
  min-height: 150px;
}

.collage-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-collage-skog {
  grid-template-columns: 1.16fr 0.84fr;
  min-height: 360px;
}

.image-collage-skog .collage-card-tall {
  min-height: 348px;
}

.image-collage-skog .collage-stack .collage-card {
  min-height: 168px;
}

.image-collage-skog .collage-stack .collage-card:last-child img {
  object-position: center 62%;
}

.image-collage-handverk {
  grid-template-columns: 1fr 1fr;
  min-height: 360px;
}

.image-collage-handverk .collage-card-wide {
  grid-column: 1 / -1;
  min-height: 200px;
}

.image-collage-handverk .collage-card:not(.collage-card-wide) {
  min-height: 150px;
}

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

.contact-section {
  padding-bottom: 44px;
}

.contact-card {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  padding: 34px;
  color: var(--text-light);
  background:
    radial-gradient(circle at top right, rgba(221, 176, 137, 0.18), transparent 30%),
    linear-gradient(150deg, rgba(29, 42, 39, 0.98), rgba(47, 67, 63, 0.96));
}

.contact-card p {
  margin: 16px 0 0;
  color: rgba(245, 241, 232, 0.82);
}

.contact-actions {
  display: grid;
  align-content: center;
  gap: 14px;
}

.contact-item,
.contact-social {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 252, 247, 0.10);
  color: var(--text-light);
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 241, 232, 0.64);
}

.contact-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light);
  word-break: break-word;
}

.contact-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 252, 247, 0.14);
  color: var(--text-light);
  font-weight: 600;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 6px 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.footer p {
  margin: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tablet tier: keep the desktop composition, relax the density. */
@media (max-width: 1060px) {
  .card-grid,
  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card:last-child,
  .process-card:last-child {
    grid-column: 1 / -1;
  }
}

/* Narrow tablet: the copy/visual hero pairs stack, while split sections keep
   their side-by-side dialogue with the collage restacked inside its column. */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .frontpage-stage {
    padding: 24px 20px;
    min-height: 0;
  }

  .hero-visual {
    min-height: 320px;
  }

  .hero-visual-image {
    min-height: 300px;
  }

  .why-top {
    grid-template-columns: 1fr;
  }

  .image-collage {
    grid-template-columns: 1fr;
  }

  .collage-stack {
    grid-template-columns: 1fr 1fr;
  }

  .image-collage-handverk .collage-card-wide {
    grid-column: auto;
  }
}

/* Phone tier: single column; scale the rhythm, keep the language. */
@media (max-width: 720px) {
  .site-shell {
    width: min(calc(100% - 20px), var(--content-width));
    padding-top: 10px;
  }

  /* The invisible-at-this-scale grid texture only costs compositing. */
  body::before {
    display: none;
  }

  .topbar {
    margin-bottom: 10px;
    min-height: 176px;
    padding: 16px;
    border-radius: 24px;
  }

  .split-section,
  .contact-card,
  .gallery-grid,
  .card-grid,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .service-card:last-child,
  .process-card:last-child {
    grid-column: auto;
  }

  /* His manner is explain first, then show: copy leads when splits stack. */
  .split-section.reverse .split-copy {
    order: -1;
  }

  .frontpage-stage {
    margin-top: 18px;
    padding: 20px 14px;
    min-height: 0;
    border-radius: 30px;
  }

  .hero-copy {
    padding: 20px 18px;
    border-radius: 26px;
  }

  .hero-copy-visual-image {
    min-height: 200px;
    max-height: 260px;
  }

  .hero-visual {
    grid-template-columns: 1fr;
    min-height: 260px;
  }

  .hero-visual-image {
    min-height: 240px;
  }

  /* Cap the logo card so the crest floats on the photo band like on desktop.
     Floor chosen so the motto in the logo stays legible. */
  .brand {
    max-width: min(100%, 280px);
    padding: 8px 10px;
  }

  .nav {
    width: 100%;
    padding: 6px;
    gap: 3px;
    flex-wrap: wrap;
  }

  .nav a {
    font-size: 0.9rem;
    padding: 8px 7px;
  }

  .nav-call {
    display: inline-block;
  }

  h1,
  h2 {
    max-width: 100%;
  }

  /* Scale the editorial headline to phone proportion; both formulas meet the
     desktop floor at the 720px boundary, so there is no jump. */
  h1 {
    font-size: clamp(2.1rem, 9vw, 2.7rem);
  }

  h2 {
    font-size: clamp(1.7rem, 7.4vw, 2rem);
  }

  /* The desktop one-line headings are wider than small viewports; let them wrap
     instead of forcing horizontal page overflow. */
  #omrader .section-heading h2,
  #arbeidsmate .section-heading h2,
  #arbeid .section-heading h2 {
    white-space: normal;
  }

  .intro-band {
    border-radius: 28px;
    padding: 18px;
  }

  .image-collage,
  .gallery-tile {
    min-height: 260px;
  }

  .collage-card-main {
    min-height: 230px;
  }

  .image-collage-skog .collage-card-tall {
    min-height: 240px;
  }

  .footer {
    flex-direction: column;
    padding-bottom: 18px;
  }
}

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

  .hero,
  .section,
  .footer {
    animation: none;
  }

  .nav a,
  .button,
  .card-link {
    transition: none;
  }

  .nav a:hover,
  .nav a:focus-visible,
  .nav a:active,
  .button:hover,
  .button:active,
  .card-link:hover,
  .card-link:active,
  .contact-item:active,
  .contact-chip:active {
    transform: none;
  }
}
