/* Basalt Engine – Deep Tech / Dark Mode. Ingen eksterne ressurser. */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #05070b;
  --bg-2: #080c13;
  --surface: #0a1019;
  --surface-2: #0e1622;
  --line: #172334;
  --line-2: #1f3149;
  --text: #e8eef6;
  --muted: #94a3b8;
  --blue: #2f7bff;
  --cyan: #22e1ff;
  --accent: linear-gradient(120deg, #2f7bff 0%, #22e1ff 100%);
  --ok: #34d399;
  --err: #ff6b7a;
  --warn: #fbbf24;
  --radius: 14px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #7df0ff; }
h1, h2, h3 { line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--cyan); color: #00131a; padding: 10px 16px; border-radius: 8px; font-weight: 600; transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgba(5, 7, 11, .72); border-bottom: 1px solid rgba(31, 49, 73, .6); }
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-text { font-size: 1.05rem; letter-spacing: .18em; font-weight: 300; }
.brand-text strong { font-weight: 700; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 10px 0; transition: color .2s; }
.nav a:not(.btn):hover { color: var(--text); }
.nav-toggle { display: none; }

/* ---------- Knapper ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 12px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s; }
.btn-primary { background: var(--accent); color: #00131f; box-shadow: 0 0 0 0 rgba(34, 225, 255, .0), 0 8px 30px -8px rgba(34, 160, 255, .55); }
.btn-primary:hover { color: #00131f; transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(34, 225, 255, .12), 0 14px 40px -8px rgba(34, 190, 255, .7); }
.btn-ghost { color: var(--text); border-color: var(--line-2); background: rgba(14, 22, 34, .5); }
.btn-ghost:hover { color: var(--text); border-color: var(--cyan); transform: translateY(-2px); }
.btn-small { min-height: 42px; padding: 0 18px; font-size: .95rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 110px) 0 clamp(56px, 8vw, 96px); isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(60% 55% at 78% 40%, rgba(47, 123, 255, .22), transparent 70%),
  radial-gradient(40% 40% at 12% 8%, rgba(34, 225, 255, .10), transparent 70%); }
.hero-bg::before { content: ""; position: absolute; inset: 0; background-image:
  linear-gradient(rgba(34, 225, 255, .055) 1px, transparent 1px),
  linear-gradient(90deg, rgba(34, 225, 255, .055) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(70% 70% at 55% 40%, #000 20%, transparent 78%); mask-image: radial-gradient(70% 70% at 55% 40%, #000 20%, transparent 78%); }
.scan { position: absolute; left: 0; right: 0; height: 160px; top: -160px; background: linear-gradient(180deg, transparent, rgba(34, 225, 255, .08), transparent); animation: scan 9s linear infinite; }
@keyframes scan { to { transform: translateY(calc(100vh + 320px)); } }

.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: clamp(24px, 4vw, 64px); }
.eyebrow { font-family: var(--mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 18px; }
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 700; letter-spacing: -0.035em; }
.grad { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.lead { margin-top: 24px; font-size: clamp(1.05rem, 2vw, 1.25rem); color: #b6c3d4; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.chips li { font-family: var(--mono); font-size: .78rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: rgba(10, 16, 25, .6); }

.hero-visual { position: relative; }
.columns { width: 100%; height: auto; display: block; filter: drop-shadow(0 30px 60px rgba(14, 90, 190, .25)); }
.code-card { position: absolute; left: -6%; bottom: -3%; width: min(300px, 62%); background: rgba(8, 13, 21, .88); border: 1px solid var(--line-2); border-radius: 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(34, 225, 255, .06); font-family: var(--mono); font-size: .8rem; animation: bob 8s ease-in-out infinite; }
.code-head { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.code-head i { width: 9px; height: 9px; border-radius: 50%; background: #243348; display: inline-block; }
.code-head span { margin-left: 8px; }
.code-body { margin: 0; padding: 14px; line-height: 1.65; white-space: normal; overflow: hidden; color: var(--text); }
.code-body b { font-weight: 400; }
.k { color: #7dd3fc; } .s { color: #86efac; } .n { color: #fbbf77; } .p { color: #8394aa; }
.arrow { color: var(--cyan); font-size: .72rem; letter-spacing: .06em; }
.code-body span { display: block; white-space: pre; opacity: 0; animation: line-in .5s var(--ease) forwards; }
.l1 { animation-delay: .6s !important; } .l2 { animation-delay: 1.4s !important; } .l3 { animation-delay: 2s !important; }
.l4 { animation-delay: 2.2s !important; } .l5 { animation-delay: 2.4s !important; } .l6 { animation-delay: 2.6s !important; }
.code-ok { display: flex; align-items: center; gap: 8px; margin: 0 14px 14px; padding: 7px 12px; width: max-content; border-radius: 999px; background: rgba(52, 211, 153, .12); color: var(--ok); border: 1px solid rgba(52, 211, 153, .35); font-size: .74rem; opacity: 0; animation: line-in .5s var(--ease) 3s forwards; }
@keyframes line-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Seksjoner ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; }
.section.alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-block: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 44px; }
h2 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 700; }
.sub { margin-top: 16px; color: var(--muted); font-size: 1.1rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; transition: transform .35s var(--ease), border-color .35s, box-shadow .35s; }
.card:hover { transform: translateY(-4px); border-color: rgba(34, 225, 255, .5); box-shadow: 0 20px 50px -24px rgba(34, 160, 255, .5); }
.card h3 { font-size: 1.4rem; margin: 22px 0 10px; }
.card p { color: var(--muted); }
.ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: rgba(34, 225, 255, .08); border: 1px solid rgba(34, 225, 255, .28); }
.ico svg { width: 26px; height: 26px; fill: none; stroke: var(--cyan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.principles li { padding: 30px 26px 8px 0; border-right: 1px solid var(--line); padding-left: 26px; }
.principles li:first-child { padding-left: 0; }
.principles li:last-child { border-right: 0; }
.num { font-family: var(--mono); color: var(--cyan); font-size: .85rem; }
.principles h3 { font-size: 1.5rem; margin: 14px 0 10px; }
.principles p { color: var(--muted); }

.contact { text-align: center; }
.contact .section-head { margin-inline: auto; }
.mail { margin-top: 8px; }
.notice { display: inline-block; padding: 16px 26px; border: 1px dashed var(--line-2); border-radius: 12px; color: var(--muted); font-family: var(--mono); font-size: .95rem; }

/* ---------- Verktøy ---------- */
.tool { position: relative; border: 1px solid var(--line-2); border-radius: 18px; background: linear-gradient(180deg, rgba(14, 22, 34, .92), rgba(8, 12, 19, .96)); padding: 18px; box-shadow: 0 40px 100px -40px rgba(20, 110, 255, .35); }
.tool::before { content: ""; position: absolute; inset: -1px; border-radius: 19px; padding: 1px; background: linear-gradient(135deg, rgba(47, 123, 255, .6), transparent 35%, transparent 65%, rgba(34, 225, 255, .5)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-bottom: 16px; }
.spacer { flex: 1; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; padding: 3px; }
.seg button { font: inherit; font-weight: 600; font-size: .95rem; min-height: 40px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #00131f; }
.field { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; }
.field select { font: inherit; font-size: .92rem; min-height: 44px; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; }
.check { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: #22c4ff; }
.btn-tool { font: inherit; font-size: .9rem; font-weight: 500; min-height: 44px; padding: 0 16px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.btn-tool:hover:not(:disabled) { border-color: var(--cyan); transform: translateY(-1px); }
.btn-tool:disabled { opacity: .4; cursor: not-allowed; }
.btn-accent { background: var(--accent); color: #00131f; border-color: transparent; font-weight: 700; }

.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pane { min-width: 0; display: flex; flex-direction: column; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); flex-wrap: wrap; }
.pane-head .meta { text-transform: none; letter-spacing: 0; }
.actions { display: inline-flex; gap: 8px; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-family: var(--font); }
textarea, .output { width: 100%; height: clamp(300px, 46vh, 520px); margin: 0; padding: 16px; background: var(--bg); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; font-family: var(--mono); font-size: .88rem; line-height: 1.6; tab-size: 2; white-space: pre; overflow: auto; resize: vertical; }
textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: transparent; }
.output { resize: none; }
.output .ph { color: #5d6e84; font-family: var(--font); }
.t-k { color: #7dd3fc; } .t-s { color: #86efac; } .t-n { color: #fbbf77; } .t-l { color: #c4b5fd; } .t-p { color: #8394aa; }

.status { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); font-size: .95rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #475569; flex: none; }
.status[data-state="ok"] { border-color: rgba(52, 211, 153, .45); } .status[data-state="ok"] .dot { background: var(--ok); box-shadow: 0 0 12px var(--ok); }
.status[data-state="error"] { border-color: rgba(255, 107, 122, .55); } .status[data-state="error"] .dot { background: var(--err); box-shadow: 0 0 12px var(--err); }
.warnings { margin-top: 12px; display: grid; gap: 8px; }
.warnings li { padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .06); color: #fde7a6; font-size: .9rem; }
.error { margin-top: 12px; padding: 16px; border-radius: 12px; border: 1px solid rgba(255, 107, 122, .5); background: rgba(255, 107, 122, .06); }
.error[hidden], .warnings[hidden] { display: none; }
.err-msg { font-weight: 600; color: #ffd0d5; }
.err-pos { margin-top: 4px; font-family: var(--mono); font-size: .85rem; color: var(--err); }
.err-excerpt { margin: 12px 0 0; padding: 12px 14px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); font-family: var(--mono); font-size: .85rem; overflow-x: auto; color: var(--text); }
.err-hint { margin-top: 12px; color: var(--muted); font-size: .95rem; }
.err-hint:empty { display: none; }
#goto-error { margin-top: 14px; }
.privacy-note { margin-top: 22px; color: var(--muted); font-size: .95rem; text-align: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .95rem; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot nav { display: flex; gap: 22px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }

/* ---------- Tekstsider ---------- */
.prose { padding: clamp(48px, 7vw, 96px) 0; }
.prose h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 28px; }
.prose h2 { font-size: 1.5rem; margin: 36px 0 10px; }
.prose p, .prose li { color: #b6c3d4; }
.prose ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; margin-top: 10px; }

/* ---------- Animasjon ved scrolling ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsivt ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; margin-inline: auto; }
  .cards { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr 1fr; }
  .principles li { border-right: 0; padding-left: 0; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
  .panes { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .js .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; background: transparent; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; color: var(--text); }
  .burger, .burger::before { display: block; width: 20px; height: 2px; background: currentColor; position: relative; border-radius: 2px; }
  .burger::before { content: ""; position: absolute; top: -6px; box-shadow: 0 12px 0 currentColor; }
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 20px 22px; background: rgba(5, 7, 11, .97); border-bottom: 1px solid var(--line); }
  .js .nav.open { display: flex; }
  .js .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .js .nav .btn { margin-top: 18px; }
  html:not(.js) .nav { flex-wrap: wrap; gap: 4px 18px; padding: 8px 0; }
  html:not(.js) .bar { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .wrap, .narrow { width: calc(100% - 32px); }
  .principles { grid-template-columns: 1fr; }
  .tool { padding: 12px; border-radius: 14px; }
  textarea, .output { font-size: 16px; height: 280px; }
  .code-card { position: relative; left: 0; bottom: 0; width: 100%; margin-top: -40px; }
  .cta-row .btn { flex: 1 1 100%; }
  .seg { width: 100%; } .seg button { flex: 1; }
  .btn-tool { flex: 1 1 auto; }
  .actions { width: 100%; } .actions .btn-tool { flex: 1; }
  .tool-bar .spacer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .scan { display: none; }
  .js .reveal { opacity: 1; transform: none; }
  .code-body span, .code-ok { opacity: 1; }
}

.center { text-align: center; }
.mt { margin-top: 28px; }

/* ---------- Kontaktskjema ---------- */
.contact .section-head { margin-bottom: 32px; }
.kform-boks { text-align: left; border: 1px solid var(--line-2); border-radius: 18px; background: linear-gradient(180deg, rgba(14, 22, 34, .92), rgba(8, 12, 19, .96)); padding: clamp(18px, 3.5vw, 36px); box-shadow: 0 40px 100px -50px rgba(20, 110, 255, .35); }
.kform { display: grid; gap: 20px; }
.kform[hidden], .kform-ok[hidden] { display: none; }
.kform-merk { color: var(--muted); font-size: .9rem; }
.kform-rad { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.kform-felt { display: grid; gap: 8px; min-width: 0; align-content: start; }
.kform label { font-weight: 600; font-size: .98rem; color: var(--text); }
.kform .valgfri { font-weight: 400; color: var(--muted); }
.krav { color: var(--cyan); }
.kform input[type="text"], .kform input[type="email"], .kform textarea { width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--text); background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; height: auto; resize: vertical; white-space: normal; transition: border-color .2s, box-shadow .2s; }
.kform textarea { min-height: 150px; line-height: 1.55; }
.kform input:focus-visible, .kform textarea:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-color: transparent; }
.kform [aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.kform-hjelp { color: var(--muted); font-size: .88rem; }
.kform-feiltekst { color: #ffb4bd; font-size: .93rem; font-weight: 500; }
.kform-feiltekst[hidden], .kform-feil[hidden] { display: none; }
.kform-feil { padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255, 107, 122, .55); background: rgba(255, 107, 122, .08); color: #ffd0d5; font-weight: 600; }
.kform-feil:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.kform-samtykke { display: grid !important; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; font-weight: 400 !important; color: #b6c3d4 !important; cursor: pointer; }
.kform-samtykke input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: #22c4ff; }
.kform-verifisering { display: grid; gap: 10px; justify-items: start; }
#turnstile:empty { display: none; }
.kform-send { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.kform-send .btn { min-width: 200px; }
.kform-send .btn:disabled { opacity: .65; cursor: progress; transform: none; }
.kform-status { color: var(--muted); font-size: .95rem; min-height: 1.4em; }
.kform-ok { text-align: center; padding: clamp(12px, 3vw, 28px); display: grid; gap: 14px; justify-items: center; }
.kform-ok:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }
.kform-ok h3 { font-size: 1.6rem; color: var(--ok); }
.kform-ok p { color: #b6c3d4; max-width: 34em; }
.honning { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) {
  .kform-rad { grid-template-columns: 1fr; }
  .kform-send .btn { width: 100%; }
}
