/* Cassetteverse – felles design (studio + portal) */
@font-face { font-family: "Titan One"; src: url("../fonts/TitanOne-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("../fonts/PermanentMarker-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Rubik"; src: url("../fonts/Rubik-Variable.ttf") format("truetype"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("../fonts/SpaceMono-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("../fonts/SpaceMono-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --ink: #120d1f;
  --ink-2: #241a4d;
  --ink-3: #3a2f6b;
  --paper: #fff7e6;
  --paper-2: #fff0cc;
  --lime: #b7ff3c;
  --magenta: #ff3d8b;
  --cyan: #27e1e8;
  --yellow: #ffd23f;
  --orange: #ff7a3d;
  --purple: #5b2d9e;
  --teal: #1f9aa0;
  --red: #ff4a4a;
  --green: #42d77d;
  --muted: #6b6485;
  --radius: 14px;
  --shadow: 5px 5px 0 var(--ink);
  --font-display: "Titan One", "Arial Black", system-ui, sans-serif;
  --font-marker: "Permanent Marker", "Comic Sans MS", cursive;
  --font-ui: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-ui); color: var(--ink); background: var(--ink); line-height: 1.45; }
img, svg, canvas { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }

/* ── knapper ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-display); font-size: 1rem; letter-spacing: .02em;
  padding: .6em 1.1em; border: 3px solid var(--ink); border-radius: 12px;
  background: var(--yellow); color: var(--ink); cursor: pointer; text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--lime); }
.btn.pink { background: var(--magenta); color: #fff; }
.btn.cyan { background: var(--cyan); }
.btn.ghost { background: transparent; color: inherit; box-shadow: none; border-color: currentColor; }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { font-size: .82rem; padding: .38em .75em; box-shadow: 3px 3px 0 var(--ink); border-width: 2px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.icon-btn { background: transparent; border: 0; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: .3em .45em; border-radius: 8px; }
.icon-btn:hover { background: rgba(0, 0, 0, .1); }

/* ── skjema ─────────────────────────────────────────────────────────────── */
.field { display: grid; gap: .3rem; margin-bottom: .85rem; align-content: start; }
.field > label, .field > .label { font-weight: 600; font-size: .86rem; }
.field .hint { font-size: .78rem; color: var(--muted); }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .field select, .field textarea {
  width: 100%; padding: .6em .75em; border: 2.5px solid var(--ink); border-radius: 10px; background: #fff; min-height: 2.6rem;
}
.field textarea { min-height: 5.5rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--magenta); box-shadow: 3px 3px 0 var(--magenta); }
.check { display: flex; align-items: flex-start; gap: .55rem; font-size: .9rem; }
.check input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; accent-color: var(--magenta); }
.form-error { background: #ffe1e1; border: 2px solid var(--red); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; margin-bottom: .8rem; }
.form-ok { background: #e3ffd0; border: 2px solid var(--green); border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; margin-bottom: .8rem; }

/* ── modal / toast ──────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(12, 6, 28, .72); backdrop-filter: blur(3px); z-index: 1000; display: grid; place-items: center; padding: 1rem; overflow-y: auto; }
.modal { width: min(520px, 100%); max-height: calc(100dvh - 2rem); overflow: auto; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 8px 8px 0 var(--magenta); animation: pop .22s cubic-bezier(.2, 1.4, .4, 1); }
.modal-wide { width: min(860px, 100%); }
@keyframes pop { from { transform: scale(.92) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.1rem .5rem; position: sticky; top: 0; background: var(--paper); z-index: 1; }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.modal-body { padding: .4rem 1.1rem 1.1rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: .8rem 1.1rem 1.1rem; border-top: 2px dashed rgba(18, 13, 31, .2); }
.toast-host { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 2000; max-width: min(380px, calc(100vw - 2rem)); pointer-events: none; }
.toast-host > * { pointer-events: auto; }
.toast { background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; padding: .65rem .9rem; box-shadow: 4px 4px 0 var(--ink); font-weight: 500; animation: pop .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-ok { background: #e3ffd0; } .toast-err { background: #ffe1e1; } .toast-egg { background: var(--yellow); font-family: var(--font-display); }

.chip { display: inline-flex; align-items: center; gap: .3em; padding: .12em .6em; border: 2px solid var(--ink); border-radius: 99px; font-size: .74rem; font-weight: 600; background: #fff; white-space: nowrap; }
.chip.lime { background: var(--lime); } .chip.pink { background: var(--magenta); color: #fff; } .chip.cyan { background: var(--cyan); } .chip.yellow { background: var(--yellow); } .chip.red { background: var(--red); color: #fff; } .chip.gray { background: #e8e4f3; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ── enkle tekstsider (personvern, 404) og kodeblokker ─────────────────── */
.doc-page { background: var(--paper); }
.doc { max-width: 760px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.doc.center { text-align: center; padding-top: 12vh; }
.doc h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.1; margin: .5rem 0 1rem; }
.doc h2 { font-family: var(--font-display); font-size: 1.25rem; margin: 2rem 0 .4rem; }
.doc p, .doc li { line-height: 1.6; }
.doc .doc-brand { font-family: var(--font-display); text-decoration: none; letter-spacing: .02em; }
.doc .doc-brand span + span { color: var(--magenta); }
.doc .meta { color: var(--muted); font-size: .9rem; }
.doc table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; font-size: .95rem; }
.doc th, .doc td { border: 2px solid var(--ink); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.doc th { background: var(--paper-2); }
.big404 { font-family: var(--font-display); font-size: clamp(5rem, 25vw, 11rem); line-height: 1; color: var(--magenta); text-shadow: 6px 6px 0 var(--ink); }
.code-block { background: var(--ink); color: var(--lime); font-family: var(--font-mono); font-size: .8rem; padding: .75rem 1rem; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: .5rem 0 0; }
