:root {
  --bg: #0a0d18;
  --bg2: #10142a;
  --card: #121731;
  --line: #222a4d;
  --text: #e8ebf7;
  --muted: #8d95b8;
  --brass: #f2b84b;
  --cyan: #4fd1c5;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.6;
  background-image: radial-gradient(1200px 500px at 80% -10%, #1a2150 0%, transparent 60%);
  background-repeat: no-repeat;
}
a { color: inherit; text-decoration: none; }
main, .nav, footer { max-width: 1080px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
section { padding: 64px 0 8px; }

.nav {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between;
  align-items: center; padding-top: 14px; padding-bottom: 14px;
  background: rgba(10,13,24,.85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); max-width: none;
  padding-left: max(24px, calc((100vw - 1080px) / 2 + 24px));
  padding-right: max(24px, calc((100vw - 1080px) / 2 + 24px));
}
.logo { font-family: var(--mono); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.logo-mark { background: var(--brass); color: #1a1405; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.nav nav { display: flex; gap: 20px; font-size: 14px; color: var(--muted); }
.nav nav a:hover { color: var(--text); }

.eyebrow, .status, .card-title, .scope-label, dt, .muted.small {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: lowercase;
}
.eyebrow { color: var(--cyan); margin: 0 0 12px; }
h1, h2.sec, .project-title { font-family: var(--serif); font-weight: 600; }
h1 { font-size: clamp(40px, 7vw, 72px); line-height: 1.05; margin: 0 0 18px; letter-spacing: -0.02em; }
.lead { font-size: 19px; color: #c5cbe6; max-width: 540px; margin: 0 0 28px; }

.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding-top: 80px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 10px 18px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; transition: .2s;
}
.btn:hover { border-color: var(--brass); transform: translateY(-1px); }
.btn.primary { background: var(--brass); color: #1a1405; border-color: var(--brass); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.now dl { margin: 0 0 14px; display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; font-size: 14px; }
.now dt { color: var(--muted); padding-top: 2px; }
.now dd { margin: 0; }
.card-title { color: var(--brass); margin: 0 0 14px; }
#scope { width: 100%; height: auto; background: #0b0f20; border-radius: 10px; border: 1px solid var(--line); }
.scope-label { color: var(--muted); margin: 6px 0 0; }

h2.sec { font-size: 28px; margin: 0 0 24px; display: flex; gap: 14px; align-items: baseline; }
h2.sec span { font-family: var(--mono); font-size: 14px; color: var(--brass); }
.muted { color: var(--muted); }
.muted.small { margin-top: 18px; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project { transition: .2s; }
.project:hover { transform: translateY(-3px); border-color: #3a4580; }
.project h3 { margin: 6px 0 8px; font-size: 20px; }
.project p { font-size: 15px; color: #c5cbe6; margin: 0 0 14px; }
.status { color: var(--cyan); margin: 0; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--mono); font-size: 11px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); }

.demo { display: grid; grid-template-columns: 1fr 1.5fr; gap: 24px; align-items: center; }
.demo h3 { margin: 0 0 8px; }
.demo p { color: #c5cbe6; font-size: 15px; }
.demo label { display: block; font-family: var(--mono); font-size: 13px; margin: 14px 0 0; color: var(--muted); }
.demo output { color: var(--text); margin-left: 8px; }
.demo input[type=range] { width: 100%; accent-color: var(--brass); }
.fc { font-size: 18px !important; }
.fc strong { color: var(--brass); }
#bode { width: 100%; height: auto; background: #0b0f20; border-radius: 10px; border: 1px solid var(--line); }

.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
.about-text p { margin-top: 0; color: #c5cbe6; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.fact { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.fact strong { display: block; font-size: 28px; color: var(--brass); }
.fact span { font-size: 13px; color: var(--muted); }

.chain { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.step { position: relative; }
.step .num { font-family: var(--mono); color: var(--brass); font-size: 12px; }
.step h3 { margin: 4px 0 6px; }
.step p { margin: 0; font-size: 14px; color: #c5cbe6; }
.step:not(:last-child)::after { content: "→"; position: absolute; right: -14px; top: 50%; color: var(--muted); z-index: 1; }

.contact p { margin-top: 0; font-size: 18px; max-width: 620px; }
.links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 0; }

footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 28px; padding-bottom: 36px; margin-top: 64px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 12px; }

@media (max-width: 820px) {
  .hero, .demo, .about { grid-template-columns: 1fr; }
  .grid3, .chain { grid-template-columns: 1fr; }
  .step::after { display: none; }
  .nav nav { gap: 12px; font-size: 13px; }
  .logo span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }

/* ---------- Skrivemaskin, fade ---------- */
.typed-line { font-family: var(--mono); font-size: 14px; color: var(--muted); margin: 0 0 24px; }
.typed { color: var(--brass); }
.caret { display: inline-block; width: 8px; height: 1em; background: var(--brass); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.fade-in { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.is-revealed { opacity: 1; transform: none; }

/* ---------- Meny (mobil) ---------- */
.burger { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 34px; cursor: pointer; position: relative; }
.burger span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text); transition: .2s; }
.burger span:first-child { top: 12px; } .burger span:last-child { top: 20px; }
.burger[aria-expanded="true"] span:first-child { top: 16px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 16px; transform: rotate(-45deg); }

/* ---------- Tidslinje: baner ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.filter-chip { font-family: var(--mono); font-size: 12px; background: transparent; color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; border-radius: 99px; cursor: pointer; transition: .2s; }
.filter-chip:hover { color: var(--text); }
.filter-chip.on { background: var(--brass); color: #1a1405; border-color: var(--brass); }

/* Swimlane: én samlet bane, kategorier skilles med farge */
.swimlane { position: relative; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -24px; }
.swimlane-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }
.swimlane-scroll::-webkit-scrollbar { height: 8px; }
.swimlane-scroll::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 4px; }
.swimlane-inner { position: relative; min-width: 100%; padding: 0 24px; box-sizing: content-box; }
.year-axis { position: relative; height: 30px; border-bottom: 1px solid var(--line); }
.year-tick { position: absolute; top: 0; height: 30px; line-height: 30px; padding-left: 10px; box-sizing: border-box; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: var(--muted); border-left: 1px solid var(--line); }
.year-tick.current { color: var(--brass); }
.lane { position: relative; min-height: 120px; }
.year-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); opacity: .55; pointer-events: none; }

.cat-work { --c: var(--brass); } .cat-school { --c: var(--cyan); } .cat-hobby { --c: #b48cff; }
.entry {
  position: absolute; display: flex; align-items: center; gap: 7px; margin: 0; padding: 0;
  background: none; border: 0; text-align: left; color: var(--text); cursor: default;
  font-family: var(--mono); letter-spacing: .01em; font-size: calc(10px + var(--imp, .4) * 2px);
  opacity: calc(.6 + var(--imp, .4) * .4); transition: opacity .2s;
}
.entry.clickable { cursor: pointer; }
.entry:hover, .entry:focus-visible { opacity: 1; z-index: 99 !important; outline: none; }
.entry .label, .entry .rlabel { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; color: #aab2d2; line-height: 1.2; transition: color .15s; }
.entry.clickable .label, .entry.clickable .rlabel { color: #dfe3f5; }
.entry:hover .label, .entry:hover .rlabel, .entry:focus-visible .label, .entry:focus-visible .rlabel { color: #fff; max-width: none; }
.entry.label-hidden .label, .entry.label-hidden .rlabel { opacity: 0; pointer-events: none; }
.entry.label-hidden:hover .label, .entry.label-hidden:hover .rlabel, .entry.label-hidden:focus-visible .label, .entry.label-hidden:focus-visible .rlabel { opacity: 1; }

.entry.point .marker {
  flex: none; width: calc(5px + var(--imp, .4) * 8px); height: calc(5px + var(--imp, .4) * 8px); border-radius: 50%;
  background: var(--bg); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--c); position: relative; z-index: 2;
}
.entry.point.clickable .marker { background: var(--c); }

.entry.range { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.entry.range .bar {
  display: block; position: relative; box-sizing: border-box; height: calc(3px + var(--imp, .4) * 5px); border-radius: 99px;
  background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 30%, transparent)); transition: filter .15s;
}
.entry.range:not(.clickable) .bar { background: transparent; border: 1px solid var(--c); opacity: .85; }
.entry.range:hover .bar, .entry.range:focus-visible .bar { filter: brightness(1.25); }
.entry.range.ongoing .bar::after { content: ""; position: absolute; right: -6px; top: 50%; margin-top: -4px; border-left: 6px solid var(--c); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.entry.is-faded { opacity: .12 !important; filter: saturate(.3); pointer-events: none; }

/* Tooltip */
.tip { position: fixed; z-index: 120; width: 320px; background: var(--card); border: 1px solid #3a4580; border-radius: 8px; padding: 16px 18px; font-size: 13px; box-shadow: 0 14px 40px rgba(0,0,0,.55); pointer-events: none; }
.tip[hidden] { display: none; }
.tt-cat { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.tt-cat .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brass); margin-right: 5px; vertical-align: 1px; }
.tt-title { display: block; font-family: var(--serif); font-size: 18px; font-weight: 600; margin: 4px 0 6px; }
.tip p { margin: 0 0 10px; color: #c5cbe6; }
.tip-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tip-tags i { font-style: normal; font-family: var(--mono); font-size: 10px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.tip-go { display: block; margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--brass); }

/* ---------- Tidslinje: liste (mobil) ---------- */
.tl-list { display: none; }
.tl-year h4 { font-family: var(--mono); color: var(--brass); margin: 18px 0 8px; font-size: 14px; }
.tl { margin: 0 0 10px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brass); border-radius: 12px; }
.tl.cat-school { border-left-color: var(--cyan); } .tl.cat-hobby { border-left-color: #b48cff; }
.tl .when { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tl h3 { margin: 2px 0 4px; font-size: 16px; } .tl p { margin: 0; font-size: 14px; color: #c5cbe6; }
.tl-year summary { cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 6px 0 10px; }

/* ---------- Prosjektsider ---------- */
.project-page { max-width: 760px; padding-top: 48px; }
.back { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.back:hover { color: var(--brass); }
.project-meta-row { display: flex; gap: 12px; align-items: center; margin: 28px 0 8px; font-family: var(--mono); font-size: 12px; }
.cat-tag, .status-tag { padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--cyan); }
.status-tag { color: var(--brass); } .project-year { color: var(--muted); }
.project-title { font-size: clamp(32px, 6vw, 52px); line-height: 1.1; margin: 0 0 16px; }
.project-lede { font-size: 19px; color: #c5cbe6; margin: 0 0 12px; }
.project-section { padding-top: 36px; }
.project-section h2 { font-size: 22px; margin: 0 0 10px; }
.project-section p, .project-section li { color: #c5cbe6; }
.nav nav.open-static { display: flex; }

@media (max-width: 900px) {
  .swimlane { display: none; }
  .tl-list { display: block; }
  .burger { display: block; }
  .nav nav:not(.open-static) { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 14px; }
  .nav nav:not(.open-static).open { display: flex; }
  .nav nav:not(.open-static) a { padding: 10px 0; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .fade-in { opacity: 1; transform: none; } .caret { animation: none; } }

.pdf-view { width: 100%; height: 80vh; min-height: 480px; margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.project-page .tags { margin: 14px 0 0; }
.project-section ul { padding-left: 20px; }
.project-section li { margin-bottom: 6px; }

/* ---------- Galleri ---------- */
.project-page { max-width: 920px; }
.project-page .project-lede,
.project-page .project-section > p,
.project-page .project-section > ul { max-width: 740px; }

.fig { margin: 0; }
.tile {
  position: relative; display: block; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg, #0b0f20);
  aspect-ratio: 4 / 3; cursor: zoom-in; transition: border-color .2s, transform .2s;
}
.tile img { display: block; width: 100%; height: 100%; object-fit: var(--fit, contain); }
.tile:hover, .tile:focus-visible { border-color: var(--brass); transform: translateY(-2px); outline: none; }
.tile::after {
  content: "⤢"; position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; line-height: 26px;
  text-align: center; font-size: 14px; color: #fff; background: rgba(10,13,24,.7); border-radius: 8px;
  opacity: 0; transition: opacity .2s;
}
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }
.fig figcaption {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5; color: var(--muted); margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px 16px; margin: 18px 0 4px; }
.fig-hero { margin: 26px 0 6px; }
.fig-hero .tile { aspect-ratio: auto; height: min(440px, 58vw); }
.fig-hero .tile { isolation: isolate; background: #0b0f20; }
.fig-hero .tile::before { content: ""; position: absolute; inset: -30px; z-index: -1; background: var(--src) center / cover; filter: blur(28px) brightness(.5) saturate(1.1); }
.fig-hero .tile img { object-fit: contain; position: relative; }
.fig.wide { grid-column: span 2; }
.fig.wide .tile { aspect-ratio: 8 / 3; }
@media (max-width: 700px) {
  .gallery { grid-template-columns: 1fr; }
  .tile { aspect-ratio: auto; background: transparent; }
  .tile img { height: auto; }
  .fig-hero .tile { height: auto; }
  .fig-hero .tile::before { display: none; }
  .fig.wide { grid-column: auto; }
  .fig.wide .tile { aspect-ratio: auto; }
  .tile::after { display: none; }
}

/* ---------- Lightbox ---------- */
body.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(6,8,16,.94); padding: 56px 64px 24px; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; min-height: 0; }
.lb img { max-width: 100%; max-height: calc(100vh - 170px); object-fit: contain; border-radius: 8px; background: var(--bg, #fff); }
.lb figcaption { font-family: var(--mono); font-size: 13px; line-height: 1.5; color: #c5cbe6; text-align: center; max-width: 760px; }
.lb button { position: absolute; border: 1px solid var(--line); background: rgba(18,23,49,.85); color: #fff; cursor: pointer; border-radius: 10px; font-size: 22px; line-height: 1; transition: border-color .2s; }
.lb button:hover, .lb button:focus-visible { border-color: var(--brass); outline: none; }
.lb-x { top: 14px; right: 16px; width: 40px; height: 40px; }
.lb-p, .lb-n { top: 50%; width: 44px; height: 56px; margin-top: -28px; }
.lb-p { left: 12px; } .lb-n { right: 12px; }
.lb-c { position: absolute; top: 24px; left: 20px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
@media (max-width: 700px) {
  .lb { padding: 56px 12px 16px; }
  .lb-p, .lb-n { top: auto; bottom: 14px; margin-top: 0; width: 48px; height: 44px; }
  .lb-p { left: 14px; } .lb-n { right: 14px; }
  .lb img { max-height: calc(100vh - 200px); }
}

/* ---------- Språkvelger ---------- */
.nav .lang-switch { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); }
.nav .lang-switch:hover { border-color: var(--brass); color: var(--brass); }
