/* ==========================================================================
   gnus.no
   Rolig og moderne: dyp marineblå bakgrunn, himmelblå aksent med en svak
   overgang mot cyan, Geist til tekst og Geist Mono bare til små etiketter.
   Lys modus følger operativsystemet, eller «tema lys» i terminalen.
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #0a1220;
  --bg-raised: #0f1a2d;
  --bg-sunken: #081020;
  --text: #e6edf7; /* 15.9:1 */
  --muted: #9fb0c8; /* 8.5:1 */
  --faint: #8094b0; /* 5.6:1 mot hevet flate */
  --line: rgb(159 176 200 / 0.13);
  --line-strong: rgb(159 176 200 / 0.26);
  --accent: #6fb8ff; /* 8.9:1 */
  --accent-2: #8be0ff;
  --accent-rgb: 111 184 255;
  --accent-ink: #06101f;
  --accent-soft: rgb(111 184 255 / 0.1);
  --alarm: #ff7a6b;
  --bird: 159 190 230;
  --glow: rgb(60 130 255 / 0.22);
  --glow-2: rgb(40 200 255 / 0.1);
  --grid: rgb(111 184 255 / 0.06);
  --grid-strong: rgb(111 184 255 / 0.13);
  --selection: rgb(111 184 255 / 0.3);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-small: 0.875rem;
  --fs-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --fs-lead: clamp(1.125rem, 1.02rem + 0.55vw, 1.4375rem);
  --fs-h2: clamp(1.875rem, 1.4rem + 2vw, 3rem);
  --fs-hero: clamp(2.5rem, 1.2rem + 5.4vw, 5.75rem);

  --wrap: 74rem;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f7fb;
    --bg-raised: #ffffff;
    --bg-sunken: #e8eef6;
    --text: #0d1b2e; /* 16:1 */
    --muted: #4a5a72; /* 6.5:1 */
    --faint: #5c6b82; /* 4.6:1 mot senket flate */
    --line: rgb(13 27 46 / 0.1);
    --line-strong: rgb(13 27 46 / 0.2);
    --accent: #1f5fbf; /* 5.7:1 */
    --accent-2: #0a6f94;
    --accent-rgb: 31 95 191;
    --accent-ink: #ffffff;
    --accent-soft: rgb(31 95 191 / 0.07);
    --alarm: #c2321f;
    --bird: 31 70 130;
    --glow: rgb(60 130 255 / 0.14);
    --glow-2: rgb(40 200 255 / 0.1);
    --grid: rgb(31 95 191 / 0.07);
    --grid-strong: rgb(31 95 191 / 0.14);
    --selection: rgb(31 95 191 / 0.2);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-raised: #ffffff;
  --bg-sunken: #e8eef6;
  --text: #0d1b2e;
  --muted: #4a5a72;
  --faint: #5c6b82;
  --line: rgb(13 27 46 / 0.1);
  --line-strong: rgb(13 27 46 / 0.2);
  --accent: #1f5fbf;
  --accent-2: #0a6f94;
  --accent-rgb: 31 95 191;
  --accent-ink: #ffffff;
  --accent-soft: rgb(31 95 191 / 0.07);
  --alarm: #c2321f;
  --bird: 31 70 130;
  --glow: rgb(60 130 255 / 0.14);
  --glow-2: rgb(40 200 255 / 0.1);
  --grid: rgb(31 95 191 / 0.07);
  --grid-strong: rgb(31 95 191 / 0.14);
  --selection: rgb(31 95 191 / 0.2);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Grunnlag
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--selection);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 560;
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-h2);
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.2s, color 0.2s;
}
a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.35em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 0.35em;
  font-family: var(--mono);
  font-size: 0.75em;
  line-height: 1;
}

button {
  font: inherit;
  color: inherit;
}

.muted {
  color: var(--muted);
}

/* Fremhevet tekst med svak overgang fra blå til cyan */
.hl {
  color: var(--accent);
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hl--alarm {
  color: var(--alarm);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  top: 1rem;
}

/* --------------------------------------------------------------------------
   Topplinje
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.topbar.is-scrolled {
  border-bottom-color: var(--line);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  font-size: 1.0625rem;
  font-weight: 640;
  letter-spacing: -0.03em;
  text-decoration: none;
}
.wordmark__mark {
  margin-right: 0.55rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.35rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgb(var(--accent-rgb) / 0.45);
}
.wordmark__tld {
  color: var(--muted);
  font-weight: 400;
}

.topnav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  font-size: 0.9375rem;
}
.topnav a {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.topnav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.status__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  animation: idle-pulse 1.9s ease-out infinite;
}
.status__dot.is-beat {
  animation: beat 0.5s ease-out;
}

@keyframes idle-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 0.45rem transparent;
  }
}
@keyframes beat {
  0% {
    transform: scale(1.5);
    box-shadow: 0 0 0 0 rgb(var(--accent-rgb) / 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0.5rem transparent;
  }
}

@media (max-width: 40rem) {
  .topnav {
    display: none;
  }
  .status {
    margin-left: auto;
  }
}

/* --------------------------------------------------------------------------
   Knapper
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0 1.3rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: 0.975rem;
  font-weight: 520;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s, border-color 0.25s, box-shadow 0.25s,
    transform 0.25s var(--ease);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn--primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2)));
  color: var(--accent-ink);
}
.btn--primary:hover {
  color: var(--accent-ink);
  box-shadow: 0 8px 30px -6px rgb(var(--accent-rgb) / 0.55);
}
.btn--ghost {
  background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.btn--ghost:hover {
  color: var(--text);
  border-color: var(--accent);
}
.btn kbd {
  border-color: currentColor;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Toppseksjon med stærflokken
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: min(50rem, calc(100svh - 4rem));
  padding-block: clamp(4rem, 10vh, 8rem) 5rem;
  isolation: isolate;
  overflow: hidden;
}

/* Blått lys og et prikkrutenett som tones ut mot kantene */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background: radial-gradient(60% 55% at 78% 30%, var(--glow), transparent 70%),
    radial-gradient(45% 45% at 15% 85%, var(--glow-2), transparent 70%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.2px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 45%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 45%, #000 20%, transparent 75%);
  opacity: 0.55;
}

.flock {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.hero__inner {
  position: relative;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-raised) 70%, transparent);
  font-size: var(--fs-small);
  color: var(--muted);
}
.eyebrow__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hero__title {
  max-width: 14ch;
  font-size: var(--fs-hero);
  font-weight: 580;
  line-height: 1;
  letter-spacing: -0.045em;
}

.lead {
  max-width: 36rem;
  margin-top: 2rem;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

.figcap {
  position: absolute;
  inset-inline: 0;
  bottom: 1.5rem;
  margin-block: 0;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
}
.figcap span:first-child {
  color: var(--accent);
}

/* Innholdet glir inn når siden lastes */
.js .hero__inner > * {
  animation: rise 0.9s var(--ease) both;
}
.js .hero__inner > :nth-child(2) {
  animation-delay: 0.08s;
}
.js .hero__inner > :nth-child(3) {
  animation-delay: 0.16s;
}
.js .hero__inner > :nth-child(4) {
  animation-delay: 0.24s;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }
}

/* --------------------------------------------------------------------------
   Seksjoner
   -------------------------------------------------------------------------- */

.section {
  padding-block: clamp(4.5rem, 10vw, 8rem);
  border-top: 1px solid var(--line);
}

.section__head {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.kicker {
  margin-bottom: 1.1rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kicker--alarm {
  color: var(--alarm);
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   EKG-monitor
   -------------------------------------------------------------------------- */

.signal__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}
@media (min-width: 60rem) {
  .signal__grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}
.signal__text h2 {
  margin-bottom: 1.5rem;
}
.signal__text p {
  max-width: 34rem;
}
.signal__text .muted {
  font-size: 0.95em;
}

.monitor {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background-color: var(--bg-sunken);
  /* Millimeterpapir: 1 mm og 5 mm */
  background-image: linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
  background-position: -1px -1px;
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.5);
  overflow: hidden;
}

.monitor__head,
.monitor__readout {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.1rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-sunken) 85%, transparent);
}
.monitor__head {
  border-bottom: 1px solid var(--line);
}
.monitor__live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.monitor__live i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.2s steps(2, jump-none) infinite;
}
.monitor__live--alarm {
  color: var(--alarm);
}
@keyframes blink {
  50% {
    opacity: 0.2;
  }
}

.monitor__canvas {
  display: block;
  width: 100%;
  height: clamp(11rem, 22vw, 15rem);
}

.monitor__readout {
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  border-top: 1px solid var(--line);
}
.monitor__readout p {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.monitor__readout strong {
  min-width: 3ch;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.monitor__label {
  color: var(--faint);
}
.monitor__btn {
  margin-left: auto;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font);
  font-size: var(--fs-small);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.monitor__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.monitor__btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* --------------------------------------------------------------------------
   Prosjekter – kort i rutenett
   -------------------------------------------------------------------------- */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project {
  display: flex;
}

.project__link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "no status arrow"
    "name name name"
    "body body body"
    "host host host";
  align-content: start;
  gap: 0.6rem 0.75rem;
  width: 100%;
  padding: 1.5rem 1.5rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-raised) 90%, transparent), var(--bg-raised));
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
/* Blått lys som følger pekeren (posisjon settes i main.js) */
.project__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 0%), rgb(var(--accent-rgb) / 0.14), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.project__link:hover {
  color: inherit;
  border-color: rgb(var(--accent-rgb) / 0.45);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -24px rgb(var(--accent-rgb) / 0.5);
}
.project__link:hover::before,
.project__link:focus-visible::before {
  opacity: 1;
}

.project__no {
  grid-area: no;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
}
.project__status {
  grid-area: status;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.project__status::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--faint);
}
.project__status--live {
  color: var(--accent);
  border-color: rgb(var(--accent-rgb) / 0.35);
}
.project__status--live::before {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.project__arrow {
  grid-area: arrow;
  color: var(--faint);
  transition: transform 0.3s var(--ease), color 0.2s;
}
.project__link:hover .project__arrow {
  color: var(--accent);
  transform: translate(0.15rem, -0.15rem);
}
.project__name {
  grid-area: name;
  margin-top: 0.75rem;
  font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem);
  font-weight: 580;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.project__body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.project__desc {
  color: var(--muted);
  font-size: 0.975em;
  line-height: 1.55;
}
.project__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.project__tags span {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: var(--fs-xs);
  color: var(--muted);
}
.project__host {
  grid-area: host;
  margin-top: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects__more {
  margin-top: 1.75rem;
  font-size: var(--fs-small);
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Om
   -------------------------------------------------------------------------- */

.about__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
@media (min-width: 60rem) {
  .about__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.about__grid h2 {
  margin-bottom: 1.5rem;
}
.about__grid p {
  max-width: 34rem;
}

.code {
  margin: 0;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  font-family: var(--mono);
  font-size: clamp(0.78rem, 0.72rem + 0.25vw, 0.9rem);
  line-height: 1.85;
  overflow-x: auto;
}
.code .c {
  color: var(--faint);
}
.code .k {
  color: var(--accent);
}
.code .v {
  color: var(--text);
  font-weight: 600;
}
.code .p {
  color: var(--muted);
}
.code .s {
  color: var(--accent-2);
}
.code .n {
  color: var(--alarm);
}

/* --------------------------------------------------------------------------
   Kontakt
   -------------------------------------------------------------------------- */

.contact {
  padding-bottom: clamp(5rem, 12vw, 9rem);
}
.contact__lead {
  max-width: 34rem;
  margin: 1.75rem 0 0;
  font-size: var(--fs-lead);
  color: var(--muted);
}
.contact__title {
  font-size: clamp(3.25rem, 1.5rem + 8vw, 8rem);
  font-weight: 580;
  letter-spacing: -0.055em;
  line-height: 0.95;
}
.contact__links {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
}
.contact__links li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.contact__links a {
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  font-weight: 520;
  letter-spacing: -0.02em;
  text-decoration: none;
}
/* Hele kortet er klikkbart */
.contact__links a::after {
  content: "↗";
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  padding: 1.1rem 1.3rem;
  font-size: 1.125rem;
  color: var(--faint);
  transition: color 0.2s;
}
.contact__links li:hover {
  border-color: rgb(var(--accent-rgb) / 0.45);
  transform: translateY(-2px);
}
.contact__links li:hover a,
.contact__links li:hover a::after {
  color: var(--accent);
}
@media (min-width: 36rem) {
  .contact__links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.contact__links .contact__primary {
  grid-column: 1 / -1;
  padding-block: 1.75rem 2rem;
  border-color: rgb(var(--accent-rgb) / 0.35);
  background: linear-gradient(120deg, rgb(var(--accent-rgb) / 0.12), var(--bg-raised) 70%);
}
.contact__links .contact__primary a {
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3rem);
  font-weight: 580;
  letter-spacing: -0.04em;
}
.contact__label {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.notfound {
  border-top: 0;
}
.notfound__title {
  max-width: 16ch;
  margin-bottom: 2.5rem;
  font-size: clamp(2.5rem, 1.4rem + 4.5vw, 5rem);
  letter-spacing: -0.045em;
}
.monitor--flat {
  margin-bottom: 2rem;
}
.notfound .lead {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Bunntekst
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
  color: var(--muted);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem;
}
.footer p {
  margin: 0;
}
.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
}
.footer__meta a {
  text-decoration: none;
}
.footer__dim {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--faint);
}
.kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  font-size: inherit;
}
.kbd-hint:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Terminal
   -------------------------------------------------------------------------- */

.term {
  width: min(44rem, calc(100vw - 2rem));
  max-height: min(32rem, calc(100svh - 2rem));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-sunken) 95%, transparent);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6), 0 0 60px -10px rgb(var(--accent-rgb) / 0.2);
  overflow: hidden;
}
.term[open] {
  display: flex;
  flex-direction: column;
  animation: term-in 0.35s var(--ease);
}
.term::backdrop {
  background: rgb(4 10 20 / 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
@keyframes term-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.term__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.term__lights {
  display: flex;
  gap: 0.4rem;
}
.term__lights i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--line-strong);
}
.term__title {
  flex: 1;
  text-align: center;
}
.term__close {
  min-height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: none;
  font-size: var(--fs-xs);
  color: var(--muted);
  cursor: pointer;
}
.term__close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.term__out {
  flex: 1;
  min-height: 12rem;
  padding: 1rem 1rem 0;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.term__out p {
  margin: 0;
}
.term__out .t-cmd {
  color: var(--muted);
}
.term__out .t-acc {
  color: var(--accent);
}
.term__out .t-dim {
  color: var(--faint);
}
.term__out .t-err {
  color: var(--alarm);
}
.term__out a {
  color: var(--accent);
}

.term__line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 1rem;
}
.term__line label {
  white-space: nowrap;
  color: var(--muted);
}
.term__ps1 {
  color: var(--accent);
}
.term__cwd {
  color: var(--text);
}
.term__line input {
  flex: 1;
  min-width: 0;
  min-height: 2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: max(16px, 1em); /* hindrer zoom på iOS */
  caret-color: var(--accent);
  outline: none;
}

/* --------------------------------------------------------------------------
   Redusert bevegelse
   -------------------------------------------------------------------------- */

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