/* Finnmerke – visuell profil. Orienteringskart: hvitt papir, svart blekk, brune høydekurver, oransje o-post. */
@font-face {
  font-family: "Archivo";
  src: url(/fonts/archivo-var.woff2) format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --snow: #ffffff;
  --ink: #000000;
  --ink-soft: #3d3d3d;
  --signal: #ff5a1f;
  --contour: #c9812f;
  --open: #ffe27a;
  --water: #1f6fd1;
  --line: #d9d9d9;
  --r-sticker: 12px;
  --r-control: 8px;
  --wide: 125%;
  --measure: 34rem;
}

html {
  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  color: var(--ink);
  background: var(--snow);
  -webkit-text-size-adjust: 100%;
}
body.brand {
  font: 17px/1.55 "Archivo", system-ui, sans-serif;
  margin: 0;
}
body.brand main {
  max-width: none;
  padding: 0;
}
:focus-visible {
  outline: 3px solid var(--water);
  outline-offset: 2px;
}
a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-thickness: 2px;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 20px;
}
.narrow {
  max-width: 44rem;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  text-decoration: none;
  font-weight: 800;
  font-stretch: var(--wide);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.logo svg {
  width: 1.5em;
  height: 1.5em;
  flex: none;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-header nav {
  display: flex;
  gap: 20px;
  font-size: 0.95rem;
}

/* Typografi: én familie, bredden gjør jobben. */
.display {
  font-weight: 850;
  font-stretch: var(--wide);
  font-size: clamp(2.4rem, 1.2rem + 5.2vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  max-width: 11ch;
}
.h2 {
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.h3 {
  font-weight: 750;
  font-stretch: 105%;
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 6px;
}
.lede {
  font-size: 1.2rem;
  line-height: 1.5;
  max-width: var(--measure);
  color: var(--ink-soft);
  margin: 0 0 28px;
}

/* Knapper */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  font-stretch: 110%;
  padding: 14px 24px;
  border-radius: var(--r-control);
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--snow);
  text-decoration: none;
  cursor: pointer;
  margin: 0;
}
.btn:hover {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--ink);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
}
.btn.ghost:hover {
  background: var(--ink);
  color: var(--snow);
  border-color: var(--ink);
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Hero: tekst til venstre, merket på kartet til høyre. */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 40px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 72px;
}
.contours {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* Kurvene tones ut bak teksten, så den er lett å lese. */
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 58%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 58%);
}
.contours path {
  fill: none;
  stroke: var(--contour);
  stroke-width: 1.1;
  opacity: 0.55;
  vector-effect: non-scaling-stroke;
}
.contours path.index {
  stroke-width: 2;
  opacity: 0.7;
}
.hero-text,
.hero-figure {
  position: relative;
}
.hero-figure {
  display: grid;
  justify-items: center;
  gap: 18px;
}
.hero-figure figcaption {
  font-size: 0.95rem;
  background: var(--snow);
  padding: 2px 8px;
}

/* Merket – samme proporsjoner som trykket (38 x 42 mm). */
.sticker {
  width: min(300px, 70vw);
  aspect-ratio: 38 / 42;
  background: var(--snow);
  border-radius: var(--r-sticker);
  box-shadow: 0 1px 0 var(--ink), 0 18px 40px -18px rgba(70, 40, 10, 0.45);
  outline: 1px solid rgba(0, 0, 0, 0.12);
  transform: rotate(-4deg);
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 4% 4% 5%;
  box-sizing: border-box;
  text-align: center;
  font-stretch: 100%;
  container-type: inline-size;
}
/* QR 30 mm av 38 mm bredde, som på trykket. */
.sticker svg {
  width: 79%;
  height: auto;
  display: block;
  justify-self: center;
}
/* Én linje per tekstlinje, som på trykket: størrelsen følger merkets bredde. */
.sticker-text {
  align-self: end;
  font-size: 5.6cqi;
  line-height: 1.32;
  font-weight: 600;
  white-space: nowrap;
}
.sticker-text .code {
  font-weight: 400;
  color: #585858;
}
/* Ett orkestrert øyeblikk: kurvene tegnes inn og merket legger seg på kartet. */
@media (prefers-reduced-motion: no-preference) {
  .contours path {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    animation: draw 2.2s cubic-bezier(0.3, 0.6, 0.2, 1) forwards;
  }
  .contours path:nth-child(2n) {
    animation-delay: 0.15s;
  }
  .contours path:nth-child(3n) {
    animation-delay: 0.3s;
  }
  .sticker {
    animation: land 0.9s 0.5s cubic-bezier(0.2, 0.8, 0.25, 1.05) both;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes land {
  from {
    transform: translateY(-24px) rotate(-10deg);
    opacity: 0;
  }
  to {
    transform: rotate(-4deg);
    opacity: 1;
  }
}

/* Seksjoner */
.section {
  padding-top: 72px;
  padding-bottom: 72px;
}
.section + .section {
  border-top: 1px solid var(--line);
}

.steps {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}
.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--signal);
  color: var(--ink);
  font-weight: 800;
  margin-bottom: 12px;
}
.steps p {
  margin: 0;
  color: var(--ink-soft);
}

.privacy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.checks li {
  position: relative;
  padding-left: 30px;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, var(--snow) 50%, var(--signal) 50%);
  border: 2px solid var(--ink);
  border-radius: 3px;
}

/* Pakkevelger på kartgult «åpent lende». */
.shop {
  background: var(--open);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.packages {
  border: 0;
  padding: 0;
  margin: 28px 0 20px;
  display: grid;
  gap: 10px;
}
.packages legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.pkg {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--snow);
  border: 2px solid var(--ink);
  border-radius: var(--r-control);
  padding: 14px 18px;
  cursor: pointer;
  margin: 0;
  font-weight: 400;
}
.pkg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pkg:has(input:checked) {
  box-shadow: 6px 6px 0 var(--ink);
  transform: translate(-3px, -3px);
}
.pkg:has(input:checked) .pkg-size::after {
  content: "";
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  margin-left: 0.4em;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: 0.1em;
}
.pkg:has(input:focus-visible) {
  outline: 3px solid var(--water);
  outline-offset: 3px;
}
.pkg-size {
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.25rem;
}
.pkg-meta {
  display: block;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.pkg-price {
  font-weight: 800;
  font-stretch: 112%;
  font-size: 1.35rem;
  white-space: nowrap;
}
.sheets-glyph {
  width: 64px;
  height: 40px;
}
.shop-note {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 14px 0 0;
}
.shop .wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 48px;
  align-items: start;
}

/* Funnet noe? */
.lookup form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
  margin-top: 16px;
}
.lookup label {
  display: block;
  font-weight: 700;
  margin: 0 0 6px;
}
.lookup input[name="kode"] {
  font: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  width: 10em;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--r-control);
  text-transform: uppercase;
}
.lookup button {
  font: inherit;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--r-control);
  border: 2px solid var(--ink);
  background: var(--snow);
  color: var(--ink);
  cursor: pointer;
}
.lookup button:hover {
  background: var(--ink);
  color: var(--snow);
}

/* Bunntekst */
.site-footer {
  border-top: 2px solid var(--ink);
  padding-top: 32px;
  padding-bottom: 40px;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer p {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

/* Tekstsider (vilkår, personvern) */
.prose {
  max-width: 40rem;
  padding-top: 32px;
  padding-bottom: 72px;
}
.prose h1 {
  font-weight: 850;
  font-stretch: 118%;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.prose h2 {
  font-weight: 750;
  font-stretch: 108%;
  font-size: 1.25rem;
  margin: 36px 0 8px;
}
.prose p,
.prose li {
  color: #1e1e1e;
}
.prose .updated {
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
.prose th,
.prose td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px 8px 8px 0;
  vertical-align: top;
}

/* Appsider (innlogging, mine merker) får samme skrift og knapper. */
.app {
  max-width: 40rem;
  padding-top: 8px;
  padding-bottom: 64px;
}
.app h1 {
  font-weight: 850;
  font-stretch: 115%;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.app button:not(.secondary) {
  background: var(--ink);
  font-weight: 700;
}
.app button:not(.secondary):hover {
  background: var(--signal);
  color: var(--ink);
}

/* Admin trenger bredde til tabeller. */
.app:has(.admin) {
  max-width: 72rem;
}
.admin table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
.admin th,
.admin td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px 12px 8px 0;
  vertical-align: top;
}
.admin td:first-child {
  white-space: nowrap;
}
.admin td button {
  margin: 0;
  padding: 4px 10px;
  white-space: nowrap;
}
.admin .scroll {
  overflow-x: auto;
}
.admin .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 0 0 24px;
}
.admin .stats dt {
  font-weight: 600;
}
.admin .stats dd {
  margin: 0;
}
.admin .stats dd:not(.muted) {
  font-size: 2rem;
  font-weight: 850;
  font-stretch: 115%;
}
.admin .search {
  margin: 32px 0 8px;
}
.admin .search div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.admin .search button {
  margin: 0;
}
.admin .message {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

/* «Velg flere merker» under de tre vanligste pakkene. */
.more summary {
  cursor: pointer;
  font-weight: 700;
  padding: 6px 0;
  width: max-content;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.more summary::marker {
  color: var(--signal);
}
.more-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.more-list .shop-note {
  margin: 4px 0 0;
}

/* Abonnement: spalter som i «Slik virker det», Pluss fremhevet med oransje strek. */
.plans {
  list-style: none;
  padding: 0;
  margin: 32px 0 24px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}
.plan {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
}
.plan-plus {
  border-top: 6px solid var(--signal);
  padding-top: 12px;
}
.plan .h3 {
  margin: 0;
}
.plan > p {
  margin: 0 0 12px;
}
.plan-price {
  font-weight: 850;
  font-stretch: 115%;
  font-size: 1.9rem;
  line-height: 1.1;
  margin: 6px 0 12px;
}
.plan-price span {
  font-size: 0.95rem;
  font-weight: 500;
  font-stretch: 100%;
  color: var(--ink-soft);
}
.plan-base {
  font-weight: 700;
}
.plan .checks {
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.plan .plan-how {
  margin-top: auto;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.plan-how strong {
  color: var(--ink);
}

.price-table {
  overflow-x: auto;
  margin: 24px 0;
}
.price-table table {
  border-collapse: collapse;
  width: 100%;
  max-width: 40rem;
}
.price-table th,
.price-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px 10px 0;
  white-space: nowrap;
}
.price-table td:last-child {
  font-weight: 800;
}
.price-table .sheets-glyph {
  width: 40px;
  height: 24px;
  vertical-align: middle;
  margin-right: 8px;
}

/* Bedrift: egen flate, svart blekk på hvitt med kraftig ramme. */
.business {
  border-top: 2px solid var(--ink);
  background: var(--snow);
}
.business-more {
  margin-top: 56px;
}
.business-contact {
  border: 2px solid var(--ink);
  border-radius: var(--r-control);
  padding: 24px;
  box-shadow: 6px 6px 0 var(--signal);
}
.business-contact .plan-price {
  margin-top: 0;
}

@media (max-width: 820px) {
  .hero .wrap,
  .privacy,
  .shop .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero .wrap {
    padding-top: 24px;
    padding-bottom: 56px;
    gap: 48px;
  }
  .contours {
    -webkit-mask-image: linear-gradient(180deg, transparent 38%, #000 60%);
    mask-image: linear-gradient(180deg, transparent 38%, #000 60%);
  }
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-header {
    flex-wrap: wrap;
    gap: 12px;
  }
  .site-header nav {
    gap: 16px;
    flex-wrap: wrap;
  }
  .section {
    padding-top: 56px;
    padding-bottom: 56px;
  }
  .shop .wrap {
    gap: 8px;
  }
}
@media (max-width: 560px) {
  .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 420px) {
  .pkg {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px 14px;
  }
  .sheets-glyph {
    width: 44px;
  }
}
