:root {
  --bg: #121210;
  --surface: #1B1B17;
  --line: #2A2A24;
  --track: #252520;
  --dim: #4A493F;
  --text: #F5F3EC;
  --text2: #9C978A;
  --text3: #8A8578; /* lysere enn #6F6A5D for å holde lesbar kontrast på små tekster */
  --lime: #D7FF3D;
  --ink: #121210;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: 'Sora', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
h1:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 1440px; margin: 0 auto; min-height: 100svh;
  padding: clamp(20px, 5vw, 72px) clamp(16px, 8vw, 120px);
  display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px);
}
main { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); flex: 1; }

/* ---------- topp ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--lime); }
.brand i { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); }
.switch { display: inline-flex; gap: 4px; padding: 6px; border-radius: 999px; background: var(--surface); }
.switch a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: 999px; color: var(--text2); font-size: 14px; font-weight: 700; }
.switch a[aria-current="page"] { background: var(--lime); color: var(--ink); }

h1 { font-family: var(--display); font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.06; max-width: 880px; }
.lead { margin-top: 16px; font-size: clamp(16px, 2vw, 19px); line-height: 1.6; color: var(--text2); max-width: 620px; }

/* ---------- kort ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); }
.card {
  display: flex; flex-direction: column; gap: 22px; height: 100%; min-height: 254px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 3vw, 34px);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--lime); }
.icon { width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--lime); display: grid; place-items: center; }
.icon svg { width: 24px; height: 24px; }
.icon.sm { width: 44px; height: 44px; border-radius: 12px; }
.icon.sm svg { width: 20px; height: 20px; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card h2 { font-family: var(--display); font-weight: 700; font-size: 23px; line-height: 1.2; }
.card p { font-size: 15px; line-height: 1.55; color: var(--text2); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.time { font-size: 13px; font-weight: 600; color: var(--text3); }
.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 22px; border-radius: 999px; background: var(--lime); color: var(--ink); font-size: 14px; font-weight: 700;
}
.cta.block { width: 100%; min-height: 52px; font-size: 16px; }
.cta.ghost { background: var(--track); color: var(--text); }

/* ---------- kalkulator ---------- */
.calc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.back { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text2); font-size: 15px; font-weight: 600; }
.back svg { width: 18px; height: 18px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); }
.calc h1 { font-size: clamp(28px, 4vw, 38px); margin: 12px 0 clamp(20px, 3vw, 36px); }
.calc-grid { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.panel, .result { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.panel { padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; gap: 28px; }
.result { padding: clamp(22px, 4vw, 40px); display: flex; flex-direction: column; gap: 28px; }

.field { display: flex; flex-direction: column; gap: 10px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label { font-size: 14px; font-weight: 700; color: var(--text); }
.value { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--lime); white-space: nowrap; }
.hint { font-size: 12.5px; line-height: 1.5; color: var(--text3); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--track); color: var(--text2); font-size: 14px; font-weight: 600; }
.pill[aria-pressed="true"] { background: var(--lime); color: var(--ink); font-weight: 700; }
.panel .cta { margin-top: auto; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: linear-gradient(to right, var(--lime) var(--p), var(--track) var(--p)); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 999px; background: var(--track); }
input[type=range]::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--lime); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -8px; border-radius: 50%; background: var(--lime); border: 4px solid var(--surface); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--lime); border: 4px solid var(--surface); }

.res-label { font-size: 15px; font-weight: 600; color: var(--text2); }
.big { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; row-gap: 4px; margin-top: 6px; }
.big strong { font-family: var(--display); font-weight: 700; line-height: 1; color: var(--lime); font-size: clamp(48px, 12vw, 74px); letter-spacing: -.01em; white-space: nowrap; }
.big span { font-size: 16px; color: var(--text2); }

.bars { display: flex; flex-direction: column; gap: 18px; }
.bar-head { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.bar { height: 22px; border-radius: 8px; background: var(--track); overflow: hidden; }
.fill { height: 100%; border-radius: 8px; background: var(--lime); }
.fill.dim { background: var(--dim); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.stat small { display: block; font-size: 13px; color: var(--text2); }
.stat b { font-family: var(--display); font-size: 24px; font-weight: 700; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--text2); }
.row b { color: var(--text); font-weight: 600; }

.cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(3px, 1vw, 10px); align-items: end; height: 150px; }
.col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; font-size: 11px; color: var(--text3); }
.col i { display: block; width: 100%; min-height: 4px; border-radius: 6px; background: var(--lime); }

.note { margin-top: auto; font-size: 13px; line-height: 1.55; font-style: italic; color: var(--text3); }
.note + .note { margin-top: -16px; }

/* ---------- samlet ---------- */
.samlet { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: clamp(28px, 4vw, 40px); align-items: center; flex: 1; }
.total { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.total strong { font-family: var(--display); font-weight: 700; font-size: clamp(52px, 13vw, 88px); line-height: .98; color: var(--lime); letter-spacing: -.01em; white-space: nowrap; }
.total p { font-size: 16px; line-height: 1.6; color: var(--text2); max-width: 380px; }
.list { display: flex; flex-direction: column; gap: 16px; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px clamp(16px, 2.5vw, 26px);
  transition: border-color .15s ease;
}
.item:hover { border-color: var(--lime); }
.item .icon { grid-row: 1 / 3; }
.item-title { font-size: 17px; font-weight: 600; line-height: 1.3; }
.item-title small { display: block; font-size: 12.5px; font-weight: 500; color: var(--text3); }
.item-amount { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--lime); text-align: right; white-space: nowrap; }
.item .bar { grid-column: 2 / 4; height: 10px; border-radius: 999px; }
.item .fill { border-radius: 999px; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--track); color: var(--text2); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; }

/* ---------- bunn ---------- */
.foot { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text3); }

@media (max-width: 899px) {
  .calc-grid, .samlet { grid-template-columns: minmax(0, 1fr); }
  .samlet { align-items: start; }
}
@media (max-width: 639px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card { min-height: 0; }
  .item { grid-template-columns: auto 1fr; }
  .item .icon { grid-row: 1; }
  .item-amount { grid-column: 2; text-align: left; }
  .item .bar { grid-column: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .item { transition: none; }
  .card:hover { transform: none; }
}
