@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #080808; cursor: none; }

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

canvas {
  position: fixed; top: 0; left: 0; cursor: none;
  animation: fadeIn 700ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

#mark {
  position: fixed; top: 28px; left: 50%; transform: translateX(-50%);
  z-index: 10; pointer-events: none;
  animation: fadeUpMark 800ms cubic-bezier(0.23, 1, 0.32, 1) 80ms both;
}

/* Fallback nav: en enkel flex-rad om JavaScript inte hinner (eller inte kan) lägga om
   länkarna till fasta positioner ovanpå klotens canvas-lager. */
.fallback-nav {
  position: fixed;
  inset: 0;
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: center;
  gap: 40px 56px;
  padding: 0 4vw;
  z-index: 5;
  pointer-events: none;
}

.lbl {
  position: static;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: #fff; opacity: 0.55;
  text-decoration: none;
  transition: opacity 150ms cubic-bezier(0.23, 1, 0.32, 1);
  text-align: center; transform: translateX(-50%);
  pointer-events: auto;
  z-index: 10; white-space: nowrap;
}
.lbl.hov,
.lbl:hover,
.lbl:focus-visible { opacity: 1; }

.lbl:focus-visible {
  outline: 2px solid rgba(255,255,255,0.85);
  outline-offset: 8px;
  border-radius: 4px;
}

.lbl-main {
  font-size: 11px; font-weight: 500; letter-spacing: 0.28em;
  display: block;
}
.lbl-sub {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 9px; font-weight: 300; letter-spacing: 0.14em;
  display: block; opacity: 0;
  transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1) 40ms;
  color: rgba(255,255,255,0.7);
}
.lbl.hov .lbl-sub,
.lbl:hover .lbl-sub,
.lbl:focus-visible .lbl-sub { opacity: 1; }

@media (max-width: 420px) {
  .lbl-main { font-size: 9px; letter-spacing: 0.16em; }
  .lbl-sub { font-size: 8px; letter-spacing: 0.08em; }
  .fallback-nav { gap: 28px 32px; }
}

#footer {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 10px; font-weight: 300; letter-spacing: 0.22em;
  color: #fff; opacity: 0.18; text-decoration: none;
  transition: opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 10; white-space: nowrap;
  animation: fadeUp 800ms cubic-bezier(0.23, 1, 0.32, 1) 400ms both;
}
#footer:hover, #footer:focus-visible { opacity: 0.6; }

#credit {
  position: fixed; bottom: 30px; right: 24px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 9px; font-weight: 300; letter-spacing: 0.14em;
  color: #fff; opacity: 0.12;
  pointer-events: none;
  z-index: 10; white-space: nowrap;
  animation: fadeUpRight 800ms cubic-bezier(0.23, 1, 0.32, 1) 460ms both;
}

@media (max-width: 640px) {
  #credit { display: none; }
}

#lbl0 { animation: fadeUp 800ms cubic-bezier(0.23, 1, 0.32, 1) 160ms both; }
#lbl1 { animation: fadeUp 800ms cubic-bezier(0.23, 1, 0.32, 1) 220ms both; }
#lbl2 { animation: fadeUp 800ms cubic-bezier(0.23, 1, 0.32, 1) 280ms both; }
#lbl3 { animation: fadeUp 800ms cubic-bezier(0.23, 1, 0.32, 1) 340ms both; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 0.55; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeUpMark {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 0.72; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeUpRight {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 0.12; transform: translateY(0); }
}
/* lbl.hov overrides opacity after animation settles */

@media (prefers-reduced-motion: reduce) {
  canvas, #mark, #footer, #credit, #lbl0, #lbl1, #lbl2, #lbl3 {
    animation: none !important;
  }
  #mark { opacity: 0.72; }
  #footer { opacity: 0.18; }
  #credit { opacity: 0.12; }
  .lbl { opacity: 0.55; }
}

/* Samtyckesbanner för Google Analytics */
#consent-banner {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 100;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  max-width: min(92vw, 620px);
  padding: 16px 20px;
  background: rgba(20,20,20,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: rgba(255,255,255,0.85);
  cursor: auto;
}
#consent-banner p { font-size: 12px; line-height: 1.5; margin: 0; flex: 1 1 260px; }
#consent-banner .consent-actions { display: flex; gap: 10px; cursor: auto; }
#consent-banner button {
  font-family: inherit; font-size: 11px; letter-spacing: 0.05em;
  padding: 8px 16px; border-radius: 4px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.25); background: transparent; color: #fff;
}
#consent-banner button:hover,
#consent-banner button:focus-visible { border-color: rgba(255,255,255,0.7); }
#consent-banner button.primary { background: #fff; color: #080808; border-color: #fff; }
#consent-banner[hidden] { display: none; }

@media (max-width: 480px) {
  #consent-banner { bottom: 12px; padding: 14px 16px; }
}
