  :root {
    --bg: #030806;
    --ink: #d4eee0;
    --dim: #7d9e8c;
    --accent: #3ee08a;
    --accent2: #c3ff5a;
    --glass: rgba(8, 22, 15, 0.6);
    --line: rgba(62, 224, 138, 0.22);
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; overflow: hidden; }
  * { scrollbar-width: none; }
  *::-webkit-scrollbar { display: none; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, sans-serif;
    overflow-x: hidden;
    cursor: none;
  }
  @media (hover: none) { body { cursor: auto; } #cursor, #cursor-dot { display: none; } }

  canvas#field { position: fixed; inset: 0; z-index: 0; }

  /* ljuskägla som följer musen */
  #spot {
    position: fixed; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%),
      rgba(62,224,138,0.13), rgba(195,255,90,0.04) 40%, transparent 70%);
    mix-blend-mode: screen;
  }
  /* dimma + vinjett + brus */
  #fog {
    position: fixed; inset: -20%; z-index: 1; pointer-events: none;
    background:
      radial-gradient(ellipse at 20% 30%, rgba(16,110,64,0.18), transparent 50%),
      radial-gradient(ellipse at 80% 70%, rgba(60,140,40,0.12), transparent 50%);
    filter: blur(40px);
    animation: drift 40s ease-in-out infinite alternate;
  }
  @keyframes drift { to { transform: translate(6%, -4%) rotate(8deg) scale(1.1); } }
  #vignette {
    position: fixed; inset: 0; z-index: 2; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.85) 100%);
  }
  #grain {
    position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }

  #cursor, #cursor-dot {
    position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none;
    border-radius: 50%; transform: translate(-50%, -50%);
  }
  #cursor {
    width: 38px; height: 38px; border: 1px solid rgba(62,224,138,.6);
    box-shadow: 0 0 18px rgba(62,224,138,.35);
    transition: width .25s, height .25s, border-color .25s;
  }
  #cursor.hover { width: 64px; height: 64px; border-color: var(--accent2); }
  #cursor-dot { width: 5px; height: 5px; background: var(--accent2); box-shadow: 0 0 10px var(--accent2); }

  main { position: relative; z-index: 5; }

  /* ingen markering, dragning eller högerklick – utom i formulärfälten */
  body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  input, textarea { -webkit-user-select: text; user-select: text; }
  svg, img { -webkit-user-drag: none; }

  /* besökarens IP skrivs ut i takt med att musen rör sig */
  #ip {
    position: fixed; z-index: 4; left: 50%; top: 28px; transform: translateX(-50%); /* under main, så kontaktrutan täcker */
    font-family: "Space Grotesk", ui-monospace, monospace; font-weight: 300;
    font-size: 12px; letter-spacing: .4em; text-transform: uppercase;
    color: var(--dim); white-space: nowrap; pointer-events: none;
    font-variant-numeric: tabular-nums;
  }
  #ip .lbl { opacity: .55; margin-right: .8em; }
  #ip .on { color: var(--ink); text-shadow: 0 0 10px rgba(62,224,138,.6); }
  #ip .off { color: rgba(62,224,138,.35); }
  #ip .new { color: var(--accent2); text-shadow: 0 0 12px var(--accent2); }
  #ip .geo { display: block; margin-top: 10px; text-align: center; font-size: 10px; letter-spacing: .35em; color: var(--accent2); opacity: .85; }

  /* prickad världskarta som växer fram efter IP-numret */
  canvas#map { position: fixed; inset: 0; z-index: 1; pointer-events: none; mix-blend-mode: screen; }

  .hero {
    height: 100vh; height: 100dvh; position: relative; display: grid; place-items: center; text-align: center;
    padding: 0 16px; box-sizing: border-box;
  }
  .sigil {
    width: min(70vw, 340px, 46vh); aspect-ratio: 1; position: relative;
    display: grid; place-items: center;
  }
  .sigil svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .ring1, .ring2 { transform-origin: 100px 100px; }
  .ring1 { animation: spin 60s linear infinite; }
  .ring2 { animation: spin 90s linear infinite reverse; }
  @keyframes spin { to { transform: rotate(360deg); } }

  h1 {
    font-family: "Space Grotesk", Inter, sans-serif; font-weight: 300;
    font-size: clamp(34px, 7vw, 64px); letter-spacing: .7em; margin: 0 -.7em 0 0;
    color: rgba(212,238,224,.72);
    text-shadow: 0 0 14px rgba(62,224,138,.25);
    position: relative; cursor: none; user-select: none;
    transition: color .4s, text-shadow .4s;
  }
  /* flimrar som ett lysrör när man drar över */
  .sigil:hover h1, h1.flicker {
    color: #e9fff2;
    animation: flicker 1.4s linear both;
  }
  @keyframes flicker {
    0%, 7%, 9%, 13%, 31%, 33%, 55%, 100% {
      opacity: 1;
      text-shadow: 0 0 6px rgba(195,255,90,.6), 0 0 22px rgba(62,224,138,.7), 0 0 48px rgba(62,224,138,.35);
    }
    8%, 12%, 32%, 56%, 58% { opacity: .25; text-shadow: none; }
    57% { opacity: .7; }
  }
  .sigil svg { transition: opacity .4s, filter .4s; opacity: .7; }
  .sigil:hover svg { opacity: 1; filter: drop-shadow(0 0 6px rgba(62,224,138,.5)); }

  .tag {
    margin-top: 18px; color: var(--dim); letter-spacing: .35em; text-transform: uppercase;
    font-size: 12px; min-height: 1.4em;
  }
  .open-contact {
    position: absolute; bottom: max(24px, 4vh); left: 50%; transform: translateX(-50%);
    width: auto; margin: 0; padding: 14px 34px; border-radius: 999px;
    animation: breathe 3.2s ease-in-out infinite;
  }
  .open-contact:hover { transform: translateX(-50%) translateY(-2px); }
  @keyframes breathe {
    50% { box-shadow: 0 0 34px rgba(62,224,138,.55), 0 0 4px rgba(195,255,90,.6) inset; }
  }

  /* kontaktrutan trillar ner ovanifrån, studsar och faller ut nedåt när den stängs */
  .modal {
    position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
    padding: 16px; overflow-y: auto; overflow-x: hidden; visibility: hidden;
  }
  .modal.open { visibility: visible; }
  .modal-backdrop {
    position: fixed; inset: 0; background: rgba(1,6,3,.55);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    opacity: 0; transition: opacity .45s ease;
  }
  .modal.open .modal-backdrop { opacity: 1; }
  .modal.open .card { animation: drop-in .95s cubic-bezier(.3,.7,.4,1) both; }
  .modal.open.closing .card { animation: fall-out .5s cubic-bezier(.55,0,1,.45) both; }
  .modal.closing .modal-backdrop { opacity: 0; }
  @keyframes drop-in {
    0%   { transform: translateY(-120vh) rotate(-8deg); }
    55%  { transform: translateY(14px) rotate(1.5deg) scaleY(.97);
           box-shadow: 0 0 90px rgba(62,224,138,.45), inset 0 0 40px rgba(62,224,138,.12); }
    70%  { transform: translateY(-10px) rotate(-.8deg); }
    84%  { transform: translateY(3px) rotate(.3deg); }
    100% { transform: none; }
  }
  @keyframes fall-out {
    to { transform: translateY(120vh) rotate(10deg); }
  }
  .close {
    position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; margin: 0; padding: 0;
    border-radius: 50%; border-color: var(--line); background: transparent;
    font-size: 20px; letter-spacing: 0; line-height: 1; color: var(--dim);
  }
  .close:hover { color: var(--ink); transform: rotate(90deg); }
  .card {
    width: 100%; max-width: 480px; padding: 28px 26px;
    background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 0 60px rgba(16,110,64,.18), inset 0 0 40px rgba(62,224,138,.05);
    position: relative; overflow: hidden;
  }
  /* kortets kant lyser där musen är */
  .card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: radial-gradient(300px circle at var(--cx, -100px) var(--cy, -100px), var(--accent2), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  }
  .card h2 { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 300; letter-spacing: .35em; text-transform: uppercase; margin: 0 0 6px; font-size: 26px; }
  .card p.lead { color: var(--dim); margin: 0 0 16px; font-size: 14px; }

  label { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin: 14px 0 6px; }
  input, textarea {
    width: 100%; background: rgba(3,8,6,.6); color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
    font: inherit; font-size: 15px; outline: none; transition: border-color .2s, box-shadow .2s;
    cursor: none;
  }
  @media (hover: none) { input, textarea { cursor: auto; } }
  input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62,224,138,.15); }
  textarea { min-height: 100px; resize: none; }
  .hp { position: absolute; left: -9999px; }

  altcha-widget {
    display: block; margin-top: 16px;
    --altcha-max-width: 100%;
    --altcha-border-color: var(--line);
    --altcha-border-radius: 10px;
    --altcha-color-base: rgba(3,8,6,.6);
    --altcha-color-base-content: var(--ink);
    --altcha-color-primary: var(--accent);
    --altcha-color-primary-content: #fff;
    --altcha-color-success: var(--accent2);
    --altcha-color-success-content: #030806;
    --altcha-color-error: #ff7b9c;
    --altcha-color-neutral: var(--dim);
    --altcha-checkbox-border-color: var(--accent);
    --altcha-spinner-color: var(--accent2);
  }
  button {
    margin-top: 18px; width: 100%; padding: 13px; border-radius: 10px;
    border: 1px solid var(--accent); background: linear-gradient(135deg, rgba(62,224,138,.25), rgba(195,255,90,.15));
    color: #fff; font: inherit; letter-spacing: .3em; text-transform: uppercase; font-size: 13px;
    cursor: none; transition: box-shadow .25s, transform .25s;
  }
  button:hover { box-shadow: 0 0 30px rgba(62,224,138,.45); transform: translateY(-1px); }
  button:disabled { opacity: .4; box-shadow: none; transform: none; }
  .status { margin-top: 14px; font-size: 13px; min-height: 1.2em; text-align: center; }
  .status.ok { color: var(--accent2); } .status.err { color: #ff7b9c; }


  @media (prefers-reduced-motion: reduce) {
    .ring1, .ring2, #fog, .open-contact { animation: none; }
    .modal.open .card, .modal.open.closing .card { animation: none; }
    .modal-backdrop { transition: none; }
  }
