:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --accent: #3d4bc4;
  --accent-soft: #e9ebfb;
  --keycap: #f2f2f5;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #1c1c1f;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #2e2e33;
    --accent: #8d98ff;
    --accent-soft: #1f2347;
    --keycap: #2a2a2e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* Språk: innholdet finnes på begge språk, og html[lang] avgjør hva som vises. */
html[lang="nb"] [lang="en"], html[lang="en"] [lang="nb"] { display: none !important; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
/* Veksler mellom appene, slik at sidene oppleves som ett nettsted. */
header.top .apps { display: flex; gap: 4px; }
header.top .apps a {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px;
  border-radius: 999px; font-weight: 600; color: var(--muted);
}
header.top .apps a img { width: 26px; height: 26px; }
header.top .apps a:hover { color: var(--text); background: var(--keycap); text-decoration: none; }
header.top .apps a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.lang-toggle {
  font: inherit; font-size: 14px; color: var(--muted);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; cursor: pointer;
}
.lang-toggle:hover { color: var(--text); }

.hero { text-align: center; padding-top: 48px; padding-bottom: 56px; }
.hero img { width: 160px; height: 160px; }
.hero h1 { font-size: clamp(40px, 8vw, 64px); line-height: 1.05; margin: 18px 0 10px; letter-spacing: -0.02em; }
.hero p.lede { font-size: clamp(19px, 3vw, 23px); color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.badge {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 16px;
}
.badge:hover { text-decoration: none; opacity: 0.88; }
.hero .meta { margin-top: 14px; font-size: 14px; color: var(--muted); }

section { padding: 48px 0; border-top: 1px solid var(--line); }
section h2 { font-size: 30px; letter-spacing: -0.01em; margin: 0 0 8px; }
section > .wrap > p.intro { color: var(--muted); margin: 0 0 28px; max-width: 640px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px; margin-bottom: 10px;
}
.step h3, .feature h3 { margin: 0 0 6px; font-size: 18px; }
.step p, .feature p { margin: 0; color: var(--muted); font-size: 16px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 28px 32px; }

/* Tidslinje-illustrasjon: inn-segmenter er hele, ut-segmenter skraverte. */
.timeline { display: flex; height: 44px; border-radius: 10px; overflow: hidden; margin: 8px 0 10px; border: 1px solid var(--line); }
.timeline span { height: 100%; }
.timeline .in { background: var(--accent); opacity: 0.85; }
.timeline .out {
  background: repeating-linear-gradient(135deg, var(--keycap) 0 6px, var(--line) 6px 12px);
}
.timeline span + span { border-left: 2px solid var(--bg); }
.legend { display: flex; gap: 18px; font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .in { background: var(--accent); }
.legend .out { background: repeating-linear-gradient(135deg, var(--keycap) 0 3px, var(--line) 3px 6px); border: 1px solid var(--line); }

table.keys { width: 100%; border-collapse: collapse; font-size: 16px; }
table.keys td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.keys td:first-child { width: 150px; white-space: nowrap; padding-right: 16px; }
table.keys tr.group td { border-bottom: none; padding-top: 22px; font-weight: 600; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
kbd {
  display: inline-block; min-width: 26px; padding: 1px 7px; margin-right: 3px; text-align: center;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--keycap); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
}

dl.faq dt { font-weight: 600; margin-top: 20px; }
dl.faq dd { margin: 4px 0 0; color: var(--muted); }

.prose { max-width: 680px; }
.prose h1 { font-size: clamp(32px, 6vw, 44px); letter-spacing: -0.02em; margin: 32px 0 4px; line-height: 1.1; }
.prose .updated { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.prose .summary {
  background: var(--accent-soft); border-radius: var(--radius); padding: 18px 20px; font-size: 18px; margin-bottom: 28px;
}
.prose h2 { font-size: 21px; margin: 32px 0 6px; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 22px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer nav { display: flex; gap: 20px; }

/* Lenke til den andre appen fra samme utvikler. */
.other-app {
  display: flex; align-items: center; gap: 18px; max-width: 640px;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text);
}
.other-app:hover { text-decoration: none; border-color: var(--accent); }
.other-app img { width: 72px; height: 72px; flex: none; }
.other-app h3 { margin: 0 0 4px; font-size: 18px; }
.other-app p { margin: 0; color: var(--muted); font-size: 16px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 28px; padding-bottom: 40px; }
  .hero img { width: 120px; height: 120px; }
  table.keys td:first-child { width: 112px; }
  .other-app img { width: 56px; height: 56px; }
}
