/* ================================
   KrabVision – Global Styles (FIXAD)
   ================================ */

:root {
  --bg: #0b1220;
  --bg-2: #0f1830;
  --fg: #e6f0ff;
  --muted: #94a3b8;
  --neon: #00e6ff;
  --iris: #7c4dff;
  --magenta: #ff3d7f;
  --lime: #a7ff83;
  --card: #0f1628;
  --ring: 0 0 0 2px rgba(0, 230, 255, .25), 0 8px 40px rgba(124, 77, 255, .25);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,77,255,.25), transparent 60%),
    radial-gradient(1000px 500px at -10% 110%, rgba(0,230,255,.20), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--fg);
}

img, video, canvas {
  max-width: 100%;
  height: auto;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 100 100"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)"/></svg>');
}

canvas#grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .35;
  filter: blur(.2px) saturate(120%);
}

/* ========= Layout ========= */

header {
  width: 100%;
  padding: 24px 24px 0;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 50; /* säkra ovanpå eventuella overlays */
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7vh 24px 10vh;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 950px) {
  .hero { grid-template-columns: 1fr; }
}

/* ========= Brand ========= */

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
}

.logo-pic { width: 44px; height: 44px; }
.logo-text { font-size: 1.5rem; font-weight: bold; }

/* ========= Navigation ========= */

header nav {
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}

header nav ul {
  display: flex;            /* <-- synlig på desktop */
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

header nav li { margin: 0; padding: 0; }

header nav a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
  border: 1px solid rgba(0, 230, 255, .35);
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(15, 22, 40, .65), rgba(15, 22, 40, .35));
  line-height: 1.1;
  transition: all 0.3s ease;
}

header nav a:hover {
  color: var(--iris);
  background: linear-gradient(180deg, rgba(15, 22, 40, .85), rgba(15, 22, 40, .45));
}

header nav .btn {
  background-color: var(--magenta);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

header nav .btn:hover { background-color: var(--lime); }

/* ========= Hamburger menu ========= */

.menu-toggle {
  display: none; /* visas bara på mobil */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.menu-icon {
  width: 30px;
  height: 3px;
  background-color: var(--fg);
  position: relative;
}

.menu-icon:before,
.menu-icon:after {
  content: '';
  position: absolute;
  width: 30px;
  height: 3px;
  background-color: var(--fg);
}

.menu-icon:before { top: -10px; }
.menu-icon:after  { top: 10px; }

/* Animera hamburgermenyknappen */
.menu-toggle.open .menu-icon { background-color: transparent; }
.menu-toggle.open .menu-icon:before { transform: rotate(45deg); top: 0; }
.menu-toggle.open .menu-icon:after  { transform: rotate(-45deg); top: 0; }

/* ========= Mobilanpassning ========= */

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    flex-wrap: wrap;
    overflow: visible;
  }

  /* Visa hamburgaren på mobil */
  .menu-toggle { display: block; }

  /* Stängd meny som default på mobil */
  header nav ul {
    display: none;          /* <-- bara mobil */
    width: 100%;
  }

  /* När menyn öppnas (lägg .open på nav via JS) */
  header nav.open ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin: 8px 0 0;
    padding: 0;
  }

  header nav li { margin: 0; }

  header nav a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    border: 1px solid rgba(0, 230, 255, .35);
    border-radius: 999px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(15, 22, 40, .65), rgba(15, 22, 40, .35));
  }

  header nav .sep { display: none; }

  /* Hero: kolumnlayout */
  .hero {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  h1 { font-size: clamp(26px, 8vw, 40px); }
  .lead { font-size: 1rem; }

  .cta { flex-direction: column; align-items: stretch; }
  .input, .btn { width: 100%; }

  .card, .tile { padding: 20px; }
  .howto, .faq { padding: 1rem; }
}

/* ========= Extra liten skärm ========= */

@media (max-width: 480px) {
  header { padding: 12px; }
  header nav a { flex: 1 1 100%; }

  h1 { font-size: 1.6rem; }
  .lead { font-size: 0.95rem; }

  .chip { font-size: 0.75rem; padding: 4px 8px; }
  .logo-badge { width: 28px; height: 28px; }
  .logo-text { font-size: 1rem; }
}
