/* =====================================================================
   Stil: Doppler — "violet-lit vault at midnight". Nära-svart violett
   canvas, EN grön aktionsfärg (max en per vy), lavendel för brandröst,
   gradient-ord i heron. En enda font (Inter som Doppler Repro-ersättare,
   vikt 450 som arbetsvikt). Kort 20px, knappar 12px, små element 8px.
   Inga skuggor — ytsteg och hårlinjer separerar.
   ===================================================================== */
:root {
  /* Colors */
  --color-midnight-plum: #1c1624;
  --color-shadow-plum: #2d2734;
  --color-elevated: #3a3340;
  --color-bone-white: #f1f0ec;
  --color-fog-line: #e5e7eb;
  --color-ash-veil: #d0c9c4;
  --color-mid-ash: #a5a2a5;
  --color-iron-edge: #55505b;
  --color-lavender-spark: #b997ff;
  --color-signal-green: #00f575;
  --color-neon-violet: #6b13f5;
  --color-ember-orange: #ff5632;
  --color-plasma-pink: #ff9efa;

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-small: 8px;
  --radius-buttons: 12px;
  --radius-cards: 20px;

  --border-hairline: rgba(229, 231, 235, 0.14);

  --nav-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--color-midnight-plum);
  color: var(--color-bone-white);
  font-family: var(--font-sans);
  font-weight: 450;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--color-lavender-spark);
  color: var(--color-midnight-plum);
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- Glass header ---- */
nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(28, 22, 36, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.1);
}
nav .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-bone-white);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.18px;
}
.brand .asterisk {
  color: var(--color-lavender-spark);
  font-size: 22px;
  line-height: 1;
}
nav .links {
  display: flex;
  align-items: center;
  gap: 8px;
}
nav .links a {
  color: var(--color-bone-white);
  text-decoration: none;
  font-weight: 450;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-buttons);
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
nav .links a:hover { color: var(--color-lavender-spark); }
nav .links a.btn-ghost-outline {
  margin-left: 8px;
  padding: 8px 16px;
}
@media (max-width: 720px) {
  nav .links a:not(.btn-ghost-outline) { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-buttons);
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn .arrow { transition: transform 0.2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Den enda gröna: max en per vy */
.btn-green {
  background: var(--color-signal-green);
  color: #000000;
}
.btn-green:hover { opacity: 0.88; }

.btn-ghost-outline {
  background: transparent;
  border: 1px solid var(--color-iron-edge);
  color: var(--color-bone-white);
  font-weight: 450;
  font-size: 14px;
  padding: 10px 18px;
}
.btn-ghost-outline:hover { border-color: var(--color-ash-veil); }

.link-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-bone-white);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
}
.link-inline:hover { text-decoration: underline; }

/* ---- Hero ---- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-height) + 80px);
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
/* Aurora: rosa hotspot → djupviolett → mörker, bakom höger halva */
.hero::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -15%;
  width: 70vw;
  height: 70vw;
  max-width: 1000px;
  max-height: 1000px;
  background:
    radial-gradient(circle at 60% 40%,
      rgba(255, 158, 250, 0.16) 0%,
      rgba(107, 19, 245, 0.18) 32%,
      rgba(107, 19, 245, 0.06) 55%,
      transparent 72%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  width: 100%;
}

.eyebrow {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-lavender-spark);
}

.hero h1 {
  margin-top: 16px;
  font-weight: 700;
  font-size: clamp(52px, 7.5vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.hero h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: rise 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.hero h1 .gradient {
  background: linear-gradient(91deg, #855aff 14.92%, var(--color-ember-orange) 90.53%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

.hero .tagline {
  margin-top: 24px;
  max-width: 480px;
  font-size: 18px;
  font-weight: 450;
  letter-spacing: -0.18px;
  line-height: 1.4;
  color: var(--color-ash-veil);
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.19, 1, 0.22, 1) 0.45s forwards;
}
.hero .actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  opacity: 0;
  animation: rise 0.9s cubic-bezier(0.19, 1, 0.22, 1) 0.6s forwards;
}

/* Radar-panel: "produkten är heron" — inramad konsol med violett halo */
.radar-panel {
  position: relative;
  background: var(--color-shadow-plum);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-cards);
  box-shadow: 0 0 60px rgba(185, 151, 255, 0.15);
  aspect-ratio: 1 / 1;
  max-width: 520px;
  justify-self: end;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  animation: rise 1.2s cubic-bezier(0.19, 1, 0.22, 1) 0.3s forwards;
}
.radar-panel canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.radar-panel .radar-label {
  position: absolute;
  left: 24px;
  bottom: 20px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-mid-ash);
}
.radar-panel .radar-label .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-signal-green);
  margin-right: 8px;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 245, 117, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(0, 245, 117, 0); }
}

@media (max-width: 900px) {
  .hero { min-height: 0; padding-bottom: 40px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .radar-panel { justify-self: start; max-width: 420px; }
}

/* ---- Stats ---- */
.stats {
  margin-top: 80px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.stat-card {
  background: var(--color-shadow-plum);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-cards);
  padding: 32px;
}
.stat-card .num {
  font-weight: 500;
  font-size: clamp(48px, 5.5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card .num .suffix {
  font-size: 0.45em;
  color: var(--color-mid-ash);
  margin-left: 4px;
}
.stat-card .bar {
  margin-top: 20px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(229, 231, 235, 0.12);
  overflow: hidden;
}
.stat-card .bar .fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--color-lavender-spark);
  box-shadow: 0 0 10px rgba(185, 151, 255, 0.5);
  transition: width 1.4s cubic-bezier(0.19, 1, 0.22, 1) 0.2s;
}
.stat-card.in .bar .fill { width: var(--fill, 40%); }
.stat-card .caption {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 450;
  color: var(--color-ash-veil);
}

/* ---- Category sections (centrerade, symmetriska) ---- */
section.category {
  margin-top: 120px;
  scroll-margin-top: var(--nav-height);
  text-align: center;
}
section.category h2 {
  margin-top: 12px;
  font-weight: 500;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
section.category .category-desc {
  margin: 12px auto 0;
  max-width: 560px;
  color: var(--color-mid-ash);
  font-weight: 450;
}

.grid {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  perspective: 1200px;
  text-align: left;
}

/* Reveal-on-scroll wrapper */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1),
    transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.reveal.in { opacity: 1; transform: none; }

/* Project card */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-shadow-plum);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-cards);
  padding: 32px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%),
    rgba(185, 151, 255, 0.1), transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:hover::after, .card:focus-visible::after { opacity: 1; }
.card:hover, .card:focus-visible {
  border-color: rgba(185, 151, 255, 0.5);
  outline: none;
}
.card h3 {
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.24px;
}
.card p {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-ash-veil);
  flex-grow: 1;
}
.card .url {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-bone-white);
  word-break: break-all;
}
.card .url .arrow {
  transition: transform 0.2s ease;
  flex: none;
}
.card:hover .url .arrow { transform: translateX(4px); }

/* ---- Footer ---- */
footer {
  margin-top: 120px;
  padding: 80px 0;
  border-top: 1px solid var(--border-hairline);
  scroll-margin-top: var(--nav-height);
  text-align: center;
}
footer h2 {
  margin-top: 12px;
  font-weight: 500;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
footer h2 .lavender { color: var(--color-lavender-spark); }
footer .contact-links {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}
footer .fine-print {
  margin-top: 56px;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0.03em;
  color: var(--color-mid-ash);
}

noscript p { padding: 48px 0; color: var(--color-mid-ash); }

/* ---- Reduced motion ---- */
@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;
  }
  .hero h1 .word, .hero .tagline, .hero .actions, .radar-panel,
  .reveal { opacity: 1; transform: none; }
  .stat-card .bar .fill { width: var(--fill, 40%); }
}
