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

:root {
  --bg: #06060d;
  --bg2: #0c0c18;
  --cyan: #00d4ff;
  --purple: #9b6dff;
  --text: #dddded;
  --text-muted: rgba(221,221,237,0.55);
  --border: rgba(0,212,255,0.12);
  --muted: #4a4a6a;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
}

/* Background */
.grid-bg {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

/* Nav */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 2.5rem;
  background: rgba(6,6,13,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(125deg, #fff 30%, var(--cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  text-decoration: none;
}
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  color: var(--text-muted); text-decoration: none;
  font-size: 0.85rem; letter-spacing: 0.05em;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }

/* Sections */
main { position: relative; z-index: 1; display: block; padding-top: 6rem; }
section { position: relative; z-index: 1; }

.page-header {
  max-width: 1100px; margin: 0 auto;
  padding: 3rem 2rem 2rem;
}

.container {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem 6rem;
}

/* Hero */
#hero {
  min-height: 70vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 8rem 2rem 5rem;
}
.hero-mark {
  width: 52px; height: 52px;
  margin-bottom: 2.5rem;
  animation: fadein 0.8s ease 0.2s both;
}
.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(125deg, #fff 20%, var(--cyan) 60%, var(--purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.1;
  animation: fadein 0.9s ease 0.4s both;
}
.hero-sub {
  margin-top: 1.2rem;
  font-size: clamp(0.7rem, 1.8vw, 0.82rem);
  letter-spacing: 0.35em; text-transform: uppercase;
  color: var(--cyan); opacity: 0.8;
  animation: fadein 0.9s ease 0.7s both;
}
.hero-divider {
  width: 56px; height: 1px; margin: 3rem auto;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: fadein 0.9s ease 0.9s both;
}
.hero-desc {
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 580px; line-height: 1.8;
  animation: fadein 0.9s ease 1.1s both;
}
.hero-cta {
  margin-top: 2.5rem;
  display: inline-flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
  animation: fadein 0.9s ease 1.3s both;
}
.btn {
  padding: 0.85rem 2rem;
  border-radius: 2px;
  font-size: 0.88rem; letter-spacing: 0.08em;
  text-decoration: none;
  transition: all 0.25s;
  display: inline-block;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: rgba(0,212,255,0.1);
  border: 1px solid rgba(0,212,255,0.4);
  color: var(--cyan);
}
.btn-primary:hover { background: rgba(0,212,255,0.18); border-color: var(--cyan); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-ghost:hover { border-color: rgba(0,212,255,0.3); color: var(--text); }

.section-label {
  font-size: 0.72rem; letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--cyan); opacity: 0.7; margin-bottom: 1rem;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 600; color: var(--text);
  margin-bottom: 1.5rem; line-height: 1.2;
}
.section-body {
  font-weight: 300; font-size: 1.05rem;
  color: var(--text-muted); max-width: 680px;
  line-height: 1.8; margin-bottom: 2.5rem;
}
.section-body + .section-body { margin-top: -1.5rem; }

/* Cards (pillars / products / tools) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
  text-decoration: none;
  display: block;
  color: inherit;
}
.card:hover { border-color: rgba(0,212,255,0.25); background: rgba(0,212,255,0.03); transform: translateY(-2px); }
.card-icon {
  width: 36px; height: 36px; margin-bottom: 1.25rem;
  color: var(--cyan);
}
.card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem; font-weight: 600;
  letter-spacing: 0.03em; margin-bottom: 0.75rem;
  color: var(--text);
}
.card p {
  font-size: 0.9rem; font-weight: 300;
  color: var(--text-muted); line-height: 1.7;
}

/* Tables (Q-koder, fonetisk alfabet, båndplan) */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data-table caption { caption-side: top; text-align: left; padding: 1rem 1.25rem 0; }
table.data-table th, table.data-table td {
  padding: 0.85rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--cyan); font-weight: 600;
}
table.data-table td { color: var(--text-muted); font-weight: 300; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { color: var(--text); background: rgba(0,212,255,0.02); }

/* Tool forms */
.tool-form {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: flex-end;
  margin-bottom: 2rem;
}
.tool-field { display: flex; flex-direction: column; gap: 0.5rem; }
.tool-field label {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
}
.tool-field input {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  min-width: 160px;
}
.tool-field input:focus { outline: none; border-color: var(--cyan); }
.tool-result {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0,212,255,0.03);
  font-family: 'Space Grotesk', sans-serif;
}
.tool-result .value {
  font-size: 1.8rem; font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tool-result .label { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; font-family: 'Inter', sans-serif; }
.tool-error { color: #ff6b8a; font-size: 0.9rem; margin-top: 0.75rem; font-family: 'Inter', sans-serif; }

/* Map */
#repeater-map {
  height: 70vh;
  min-height: 420px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.marker-fm { filter: hue-rotate(0deg); }

/* Blog */
.blog-post {
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}
.blog-post:first-child { padding-top: 0; }
.blog-post-date {
  font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--cyan); opacity: 0.75; margin-bottom: 0.5rem;
}
.blog-post h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.4rem; font-weight: 600;
  margin-bottom: 1rem;
}
.blog-post-body { font-weight: 300; color: var(--text-muted); line-height: 1.8; }
.blog-post-body p { margin-bottom: 1rem; }
.blog-post-body a { color: var(--cyan); }

/* Contact */
.contact-email {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem; letter-spacing: 0.05em;
  color: var(--cyan); text-decoration: none;
  border-bottom: 1px solid rgba(0,212,255,0.3); padding-bottom: 2px;
  transition: border-color 0.2s;
}
.contact-email:hover { border-color: var(--cyan); }

/* Footer */
footer {
  position: relative; z-index: 1;
  padding: 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  border-top: 1px solid var(--border);
}
.footer-copy {
  font-size: 0.78rem; color: var(--muted); letter-spacing: 0.05em;
}
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-size: 0.78rem; color: var(--muted);
  text-decoration: none; letter-spacing: 0.05em;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--cyan); }

/* Animations */
@keyframes fadein {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  footer { flex-direction: column; align-items: flex-start; }
  .tool-form { flex-direction: column; align-items: stretch; }
}
