/* ==========================================================================
   helsekode.no
   Minimalistisk og rolig: varmt, papirhvitt underlag, nesten svart tekst med
   et snev av grønt og en dempet grønnblå aksent. Geist til tekst, Geist Mono
   bare til små etiketter. Mørk modus følger operativsystemet.
   Siden har ingen JavaScript.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f5f4ef;
  --bg-raised: #fbfaf7;
  --text: #17201d; /* 15.1:1 */
  --muted: #4f5c57; /* 6.4:1 */
  --faint: #5f6b66; /* 5.0:1 */
  --line: rgb(23 32 29 / 0.1);
  --line-strong: rgb(23 32 29 / 0.2);
  --accent: #2a6a5b; /* 5.8:1 */
  --accent-ink: #ffffff; /* 6.3:1 mot aksent */
  --accent-soft: rgb(42 106 91 / 0.08);
  --selection: rgb(42 106 91 / 0.18);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-small: 0.875rem;
  --fs-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --fs-lead: clamp(1.125rem, 1.03rem + 0.5vw, 1.375rem);
  --fs-h2: clamp(1.625rem, 1.3rem + 1.4vw, 2.375rem);
  --fs-hero: clamp(2.375rem, 1.3rem + 4.4vw, 4.75rem);

  --wrap: 68rem;
  --gutter: clamp(1.25rem, 0.6rem + 2.8vw, 2.75rem);
  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1513;
    --bg-raised: #151c19;
    --text: #e3eae6; /* 15.1:1 */
    --muted: #a0ada7; /* 7.9:1 */
    --faint: #8b9993; /* 6.2:1 */
    --line: rgb(227 234 230 / 0.1);
    --line-strong: rgb(227 234 230 / 0.2);
    --accent: #86cbb9; /* 9.9:1 */
    --accent-ink: #0f1513;
    --accent-soft: rgb(134 203 185 / 0.1);
    --selection: rgb(134 203 185 / 0.25);
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   Grunnlag
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 480;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.muted {
  color: var(--muted);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: 10px;
}
.skip-link:focus {
  top: 1rem;
}

/* Små etiketter i monospace */
.kicker {
  margin-bottom: 1.25rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 450;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Topplinje
   -------------------------------------------------------------------------- */

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark:hover {
  color: inherit;
}
.wordmark__mark {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
}
.wordmark__mark path {
  stroke: var(--bg);
}
.wordmark__kode {
  color: var(--muted);
  font-weight: 420;
}

.topnav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  font-size: 0.9375rem;
}
.topnav a {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.topnav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

@media (max-width: 30rem) {
  .topnav a:not(:last-child) {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Knapper
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0 1.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.975rem;
  font-weight: 520;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s, border-color 0.25s;
}
.btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--text));
  color: var(--accent-ink);
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Toppen
   -------------------------------------------------------------------------- */

.hero {
  padding-top: clamp(3.5rem, 1.5rem + 9vw, 9rem);
}

.hero__title {
  max-width: 15ch;
  font-size: var(--fs-hero);
  font-weight: 460;
  line-height: 1.04;
  letter-spacing: -0.04em;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  max-width: 36rem;
  margin-top: 1.75rem;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2.25rem 0 0;
}

/* En rolig pulslinje som tegnes én gang */
.pulse {
  display: block;
  width: 100%;
  height: 6rem;
  margin-top: clamp(2.5rem, 1rem + 5vw, 5rem);
  color: var(--accent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.pulse path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 3.2s var(--ease) 0.3s both;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

.hero--404 {
  min-height: 70vh;
}

/* --------------------------------------------------------------------------
   Seksjoner
   -------------------------------------------------------------------------- */

.section {
  --space: clamp(3.5rem, 2rem + 6vw, 7rem);
  padding-bottom: var(--space);
}

.section__grid {
  display: grid;
  gap: 1.75rem 4rem;
  padding-top: var(--space);
  /* Tynn skillelinje øverst, innenfor innholdsbredden */
  background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
/* Pulslinjen skiller toppen fra første seksjon */
.hero + .section .section__grid {
  background: none;
}
@media (min-width: 54rem) {
  .section__grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.6fr);
  }
}

.prose > :last-child {
  margin-bottom: 0;
}

/* Hva vi gjør */
.points {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.points li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.points__no {
  padding-top: 0.3rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
}
.points h3 {
  margin-bottom: 0.4rem;
  font-size: 1.1875rem;
  font-weight: 560;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.points p {
  margin: 0;
  color: var(--muted);
}

/* Tjenester */
.services {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem 1.5rem;
  padding: 1.6rem 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.35s var(--ease);
}
.service:hover {
  border-color: var(--accent);
  color: inherit;
  transform: translateY(-2px);
}
.service__name {
  font-size: 1.5rem;
  font-weight: 540;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.service__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: center;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent);
}
.service__status::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
}
.service__desc {
  grid-column: 1 / -1;
  color: var(--muted);
}
.service__host {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: var(--fs-small);
  color: var(--accent);
}

/* Om */
.facts {
  margin: 2.25rem 0 0;
  border-top: 1px solid var(--line);
}
.facts div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  padding-top: 0.3rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Kontakt */
.contact__mail {
  display: inline-block;
  margin-block: 0.5rem 0.25rem;
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.75rem);
  font-weight: 460;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

.note {
  max-width: 34rem;
  margin-top: 2.5rem;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 2px solid var(--line-strong);
  font-size: var(--fs-small);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Bunntekst
   -------------------------------------------------------------------------- */

.footer {
  padding-block: 2rem 2.5rem;
  font-size: var(--fs-small);
  color: var(--muted);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 2rem;
  background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.footer p {
  margin: 0;
}
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

/* --------------------------------------------------------------------------
   Redusert bevegelse
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .pulse path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .service,
  .btn {
    transition: none;
  }
  .service:hover {
    transform: none;
  }
}
