/* Mobile first. Basis er telefonen, større skærme tilføjes med min-width. */
:root {
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #1c1c1c;
  --muted: #5f6368;
  --line: #e3e5e0;
  --accent: #0f766e;
  --accent-soft: #e6f3f1;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 6px 20px rgba(16, 24, 20, .06);
  --radius: 14px;
  --k: var(--accent);
  --k-soft: var(--accent-soft);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111413;
    --card: #1a1e1c;
    --text: #ececec;
    --muted: #a3a8a6;
    --line: #2b302e;
    --accent: #2dd4bf;
    --accent-soft: #15302c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

/* Kategorifarver */
.k-loen { --k: #0f766e; --k-soft: #e3f4f1 }
.k-laan { --k: #1d4ed8; --k-soft: #e6edfd }
.k-bolig { --k: #b45309; --k-soft: #fcf0e1 }
.k-krop { --k: #be123c; --k-soft: #fde8ed }
.k-tid { --k: #6d28d9; --k-soft: #efe8fd }
.k-regn { --k: #15803d; --k-soft: #e5f5ea }
@media (prefers-color-scheme: dark) {
  .k-loen { --k: #2dd4bf; --k-soft: #143330 }
  .k-laan { --k: #7aa2ff; --k-soft: #18244a }
  .k-bolig { --k: #f5a94b; --k-soft: #3a2a14 }
  .k-krop { --k: #fb7196; --k-soft: #3d1722 }
  .k-tid { --k: #b394ff; --k-soft: #2a1d4a }
  .k-regn { --k: #4ade80; --k-soft: #15321f }
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden }
a { color: var(--accent) }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px }
main.wrap { padding-bottom: 8px }

/* Ikoner */
.ico { width: 24px; height: 24px; flex: none; display: inline-block; vertical-align: middle }
.ico.sm { width: 18px; height: 18px }
.ico.h { width: 22px; height: 22px; color: var(--k) }
.badge { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--k-soft); color: var(--k); flex: none }
.badge.sm { width: 34px; height: 34px; border-radius: 10px }
.badge.sm .ico { width: 20px; height: 20px }
.badge.big { width: 56px; height: 56px; border-radius: 16px; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both }
.badge.big .ico { width: 30px; height: 30px }

/* Top */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line) }
.top .wrap { display: flex; justify-content: space-between; align-items: center; height: 56px; gap: 12px }
.top a { text-decoration: none; font-weight: 650; display: inline-flex; align-items: center; gap: 8px; min-height: 44px }
.logo { font-size: 1.1rem; color: var(--text) !important }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; transition: transform .3s }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.05) }
@media (prefers-color-scheme: dark) { .logo-mark { color: #06201d } }
.nav span { display: none }
@media (min-width: 480px) { .nav span { display: inline } }

/* Typografi */
h1 { font-size: clamp(1.55rem, 6vw, 2.3rem); line-height: 1.2; margin: 0; letter-spacing: -.01em }
h2 { font-size: 1.2rem; margin: 32px 0 12px; display: flex; align-items: center; gap: 10px }
.lead { color: var(--muted); font-size: 1.05rem; margin: 12px 0 20px }
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--muted); margin: 16px 0 8px }
.crumbs a { color: var(--muted); text-decoration: none }
.crumbs a:hover { color: var(--accent) }
.page-head { display: flex; align-items: center; gap: 14px; margin: 12px 0 0 }
main > .page-head:first-child { margin-top: 28px }

/* Forside */
.hero { display: grid; gap: 8px; align-items: center; margin: 20px 0 8px }
.hero h1 { font-size: clamp(1.7rem, 7vw, 2.6rem) }
.hero-art { width: 100%; max-width: 420px; height: auto; max-height: 220px; justify-self: center; order: -1 }
.hero-art.small { max-height: 180px; margin: 8px 0 }
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.2fr 1fr; gap: 24px; margin: 40px 0 16px }
  .hero-art { order: 0; max-height: 280px }
}
.search { position: relative; display: block; max-width: 520px }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none }
.search input { padding-left: 46px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); min-height: 50px }
.kat { scroll-margin-top: 72px }
.kat h2 { margin-top: 28px }

/* Illustration */
.ha-shadow { fill: var(--line) }
.ha-card, .ha-device { fill: var(--card); stroke: var(--line); stroke-width: 2 }
.ha-screen { fill: var(--accent-soft) }
.ha-num { fill: var(--accent); font: 700 20px system-ui, sans-serif }
.hero-art.small .ha-num { font-size: 44px }
.ha-keys rect { fill: var(--bg); stroke: var(--line); stroke-width: 1.5 }
.ha-keys .ha-eq { fill: var(--accent); stroke: none }
.ha-bar { fill: #7aa2ff; transform-box: fill-box; transform-origin: bottom; animation: grow 2.8s ease-in-out infinite }
.ha-bar.b2 { fill: #2dd4bf; animation-delay: .2s }
.ha-bar.b3 { fill: var(--accent); animation-delay: .4s }
.ha-bar.b4 { fill: #f5a94b; animation-delay: .6s }
.ha-coin { fill: #fbbf24; stroke: #d97706; stroke-width: 3 }
.ha-coin-t { fill: #92400e; font: 800 16px system-ui, sans-serif }
.ha-pct { fill: #fde8ed; stroke: #be123c; stroke-width: 2 }
.ha-pct-t { fill: none; stroke: #be123c; stroke-width: 3; stroke-linecap: round }
.ha-spark { fill: #b394ff }
.ha-lens { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 6 }
.ha-handle { stroke: var(--accent); stroke-width: 12; stroke-linecap: round }
.ha-float { animation: float 5s ease-in-out infinite }
.ha-f2 { animation-duration: 4.2s; animation-delay: -1s }
.ha-f3 { animation-duration: 4.8s; animation-delay: -2s }
.ha-f4 { animation: twinkle 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center }

/* Kort */
.grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: 1fr }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr) } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr) } }
.grid li { animation: rise .45s ease both; animation-delay: calc(var(--i, 0) * 45ms) }
.card { display: flex; align-items: center; gap: 12px; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s }
.card-t { display: grid; gap: 2px; flex: 1; min-width: 0 }
.card-t span { color: var(--muted); font-size: .88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.card .go { width: 18px; height: 18px; color: var(--muted); transition: transform .2s, color .2s }
.card:hover, .card:focus-visible { border-color: var(--k); box-shadow: var(--shadow); transform: translateY(-2px) }
.card:hover .go { color: var(--k); transform: translateX(3px) }
.card:hover .badge .ico { animation: wiggle .5s ease }
.grid.small .card { padding: 10px 12px }
.grid.small .badge { width: 36px; height: 36px; border-radius: 10px }
.grid.small .badge .ico { width: 20px; height: 20px }

/* Beregner */
.calc { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--k); border-radius: var(--radius); padding: 16px; display: grid; gap: 18px; box-shadow: var(--shadow); animation: rise .4s ease both }
@media (min-width: 720px) { .calc { grid-template-columns: 1fr 1fr; padding: 22px; gap: 24px } }
form { display: grid; gap: 12px }
label { display: grid; gap: 4px; font-size: .92rem; color: var(--muted) }
input, select, textarea { font: inherit; font-size: max(16px, 1rem); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; min-height: 46px; transition: border-color .15s, box-shadow .15s }
textarea { resize: vertical; line-height: 1.5 }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--k); box-shadow: 0 0 0 3px var(--k-soft) }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; background: var(--k, var(--accent)); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; min-height: 48px; text-decoration: none; cursor: pointer; transition: transform .15s, filter .15s }
.btn:hover { filter: brightness(1.08) }
.btn:active { transform: scale(.98) }
@media (prefers-color-scheme: dark) { .btn { color: #0b1a17 } }
.result { background: var(--k-soft); border-radius: 12px; padding: 10px 14px; align-self: start; scroll-margin-top: 72px }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--k) 18%, transparent); animation: fade .3s ease both }
.row:last-child { border-bottom: 0 }
.row span { color: var(--muted); font-size: .95rem }
.row strong { text-align: right; font-variant-numeric: tabular-nums }
.row.big strong { font-size: 1.35rem; color: var(--k); line-height: 1.25 }
.row.pop strong { animation: pop .35s ease }

/* Affiliate */
.aff { margin: 24px 0; padding: 16px; border: 1px dashed var(--k, var(--accent)); border-radius: var(--radius); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; background: var(--card) }
.aff p { margin: 0; flex: 1 1 260px }
.aff small { width: 100%; color: var(--muted); font-size: .75rem }

/* Tekst */
.text { max-width: 720px }
.text h2 { color: var(--text) }
details { border-bottom: 1px solid var(--line); padding: 4px 0 }
summary { cursor: pointer; font-weight: 600; padding: 10px 28px 10px 0; list-style: none; position: relative; min-height: 44px }
summary::-webkit-details-marker { display: none }
summary::after { content: '+'; position: absolute; right: 4px; top: 8px; font-size: 1.3rem; color: var(--k, var(--accent)); transition: transform .2s }
details[open] summary::after { transform: rotate(45deg) }
details[open] > p { animation: fade .25s ease }

/* Bund */
.foot { color: var(--muted); font-size: .9rem; margin-top: 48px; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line) }
.foot p { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center }
.foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px }

/* Animationer */
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { 0% { transform: scale(.85) } 60% { transform: scale(1.06) } 100% { transform: scale(1) } }
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes grow { 0%, 100% { transform: scaleY(1) } 50% { transform: scaleY(.6) } }
@keyframes twinkle { 0%, 100% { transform: scale(.8); opacity: .6 } 50% { transform: scale(1.15); opacity: 1 } }
@keyframes wiggle { 0%, 100% { transform: rotate(0) } 30% { transform: rotate(-10deg) } 60% { transform: rotate(8deg) } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important }
}
