/* ============================================================
   LocalMesh Sverige – stylesheet
   ============================================================ */

/* ---- Custom properties ---- */
:root {
  --blue-se: #006AA7;       /* Swedish blue */
  --yellow-se: #FECC02;     /* Swedish yellow */
  --accent: #0ea5e9;        /* Tech accent */
  --accent-glow: rgba(14, 165, 233, 0.25);

  --bg: #080c14;
  --bg-card: #0f1623;
  --bg-dark: #060a10;
  --bg-accent: #006AA7;

  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(14, 165, 233, 0.3);

  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.2s ease;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --max-width: 1100px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p  { color: var(--text-muted); }
strong { color: var(--text); font-weight: 600; }
code {
  font-family: var(--font-mono);
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section {
  padding: 6rem 0;
}
.section-dark {
  background: var(--bg-dark);
}
.section-accent {
  background: linear-gradient(135deg, #003d6b 0%, #005a92 50%, #006AA7 100%);
}

/* ---- Gradient text ---- */
.gradient-text {
  background: linear-gradient(90deg, var(--accent) 0%, var(--yellow-se) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 0 32px var(--accent-glow);
}
.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
}
.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  border-radius: 8px;
  display: inline-flex;
  margin-top: 0.75rem;
}
.btn-small:hover {
  background: rgba(14, 165, 233, 0.2);
}
.btn-large {
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
}
.cta-center {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3rem;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background var(--transition), backdrop-filter var(--transition);
}
.site-header.scrolled {
  background: rgba(8, 12, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav-logo {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.logo-mesh { color: var(--text); }
.logo-se   { color: var(--accent); }
.logo-country {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--yellow-se);
  color: #000;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  margin-left: 0.4rem;
  letter-spacing: 0.05em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-links a {
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 600;
}
.nav-cta:hover { opacity: 0.9; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 0 4rem;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#mesh-canvas {
  width: 100%;
  height: 100%;
  opacity: 0.4;
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px transparent; }
}
.hero-title {
  margin-bottom: 1.25rem;
  font-weight: 800;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.stat-icon { font-size: 1rem; }
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-subtle);
  border-bottom: 2px solid var(--text-subtle);
  transform: rotate(45deg);
  animation: bounce 1.8s ease infinite;
}
@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3.5rem;
}
.section-header h2 { margin-bottom: 1rem; }
.section-header p { font-size: 1.05rem; line-height: 1.7; }
.section-tag {
  display: inline-block;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-tag-dark {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}

/* ============================================================
   CARDS
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 4rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.card-icon { font-size: 1.8rem; margin-bottom: 1rem; }
.card h3 { color: var(--text); margin-bottom: 0.6rem; }
.card p  { font-size: 0.92rem; }

/* ============================================================
   INFO BLOCK (How does it work)
   ============================================================ */
.info-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}
.info-text h3 { color: var(--text); margin-bottom: 1rem; font-size: 1.3rem; }
.info-text p  { margin-bottom: 0.9rem; line-height: 1.7; }
.info-visual  { display: flex; justify-content: center; align-items: center; }
.mesh-diagram { width: 100%; max-width: 300px; }
.mesh-svg { width: 100%; }
.mesh-line {
  stroke: rgba(14, 165, 233, 0.25);
  stroke-width: 1.5;
  fill: none;
}
.mesh-line.active {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 3;
  animation: dash 1.5s linear infinite;
}
@keyframes dash { to { stroke-dashoffset: -18; } }
.mesh-node {
  fill: rgba(14, 165, 233, 0.2);
  stroke: var(--accent);
  stroke-width: 2;
}
.mesh-node.source { fill: var(--accent); }
.mesh-node.dest   { fill: var(--yellow-se); stroke: var(--yellow-se); }
.mesh-node.relay  { fill: rgba(14, 165, 233, 0.4); }
.mesh-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: var(--font);
}

/* ============================================================
   SCENARIOS (Beredskap)
   ============================================================ */
.scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.scenario {
  display: flex;
  gap: 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition);
}
.scenario:hover { border-color: rgba(255,255,255,0.15); }
.scenario-icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.scenario-content h3 { color: var(--text); margin-bottom: 0.5rem; font-size: 1rem; }
.scenario-content p  { font-size: 0.9rem; }

.callout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: rgba(254, 204, 2, 0.07);
  border: 1px solid rgba(254, 204, 2, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--yellow-se);
}
.callout-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout p { font-size: 0.92rem; color: var(--text-muted); }

/* ============================================================
   STEPS (Kom igång)
   ============================================================ */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 2.5rem;
  position: relative;
}
.steps::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), transparent);
}
.step {
  display: flex;
  gap: 1.5rem;
  padding: 2rem 0;
  position: relative;
}
.step:not(:last-child) { border-bottom: 1px solid var(--border); }
.step-number {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 20px var(--accent-glow);
}
.step-content h3 { color: var(--text); margin-bottom: 0.6rem; font-size: 1.15rem; }
.step-content p  { font-size: 0.95rem; margin-bottom: 0.5rem; }
.device-list {
  list-style: disc;
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}
.device-list li {
  list-style: disc;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.step-note {
  font-size: 0.85rem !important;
  color: var(--text-subtle) !important;
  font-style: italic;
}

.tip-box {
  background: rgba(14, 165, 233, 0.07);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.tip-box h4 { color: var(--text); margin-bottom: 0.5rem; font-size: 0.95rem; }
.tip-box p  { font-size: 0.9rem; }

/* ============================================================
   NODE BENEFITS (Sätt upp en nod)
   ============================================================ */
.node-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.benefit {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: background var(--transition);
}
.benefit:hover { background: rgba(255,255,255,0.08); }
.benefit-icon { font-size: 1.8rem; margin-bottom: 1rem; }
.benefit h3 { color: #fff; margin-bottom: 0.6rem; }
.benefit p  { font-size: 0.9rem; color: rgba(255,255,255,0.65); }

.node-setup {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}
.node-setup h3 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}
.node-parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.node-part {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.part-icon { font-size: 1.5rem; flex-shrink: 0; }
.node-part div { display: flex; flex-direction: column; gap: 0.15rem; }
.node-part strong { color: #fff; font-size: 0.9rem; }
.node-part span   { color: rgba(255,255,255,0.55); font-size: 0.8rem; }

/* ============================================================
   RESOURCES
   ============================================================ */
.resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}
.resource-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
}
.resource-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.resource-icon { font-size: 1.8rem; margin-bottom: 1rem; }
.resource-card h3 { color: var(--text); margin-bottom: 0.5rem; }
.resource-card p  { font-size: 0.9rem; margin-bottom: 1rem; }
.resource-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding-top: 4rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
}
.footer-brand .nav-logo {
  display: inline-flex;
  margin-bottom: 1rem;
}
.footer-brand p { font-size: 0.88rem; max-width: 300px; color: var(--text-subtle); }
.footer-links h4 { color: var(--text); margin-bottom: 1rem; font-size: 0.9rem; }
.footer-links ul li { margin-bottom: 0.5rem; }
.footer-links a {
  color: var(--text-subtle);
  font-size: 0.88rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
}
.footer-bottom p {
  font-size: 0.82rem;
  color: var(--text-subtle);
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ---- Tablet (≤768px) ---- */
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }

  /* Nav */
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 12, 20, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 0.75rem 1rem 1.25rem;
    gap: 0.1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.75rem 1rem;   /* min ~44px tap target */
    border-radius: 8px;
    font-size: 1rem;
  }
  .site-header { background: rgba(8, 12, 20, 0.95); }

  /* Hero */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 360px;
  }
  .hero-actions .btn { text-align: center; justify-content: center; }
  .hero-stats {
    flex-direction: column;
    gap: 0.6rem;
  }

  /* Info block */
  .info-block {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.75rem;
  }
  .info-visual { order: -1; }

  /* Steps */
  .steps::before { display: none; }
  .step { padding: 1.5rem 0; gap: 1rem; }
  .step-number { width: 44px; height: 44px; font-size: 1rem; flex-shrink: 0; }

  /* Node setup */
  .node-setup { padding: 1.5rem; }
  .node-parts { grid-template-columns: 1fr 1fr; }

  /* CTA buttons – stack and stretch */
  .cta-center {
    flex-direction: column;
    align-items: stretch;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
  .cta-center .btn { text-align: center; justify-content: center; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2rem; }
  .footer { padding-top: 3rem; }
}

/* ---- Mobile (≤480px) ---- */
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .section { padding: 3rem 0; }
  .section-header { margin-bottom: 2.5rem; }

  /* Hero */
  .hero { padding: 6.5rem 0 3rem; }
  .hero-actions { max-width: 100%; }
  .hero-badge { font-size: 0.72rem; }

  /* Cards – force single column */
  .cards,
  .scenarios,
  .node-benefits,
  .resources { grid-template-columns: 1fr; }

  /* Scenario – stack icon above text */
  .scenario { flex-direction: column; gap: 0.75rem; }

  /* Info block */
  .info-block { padding: 1.25rem; }

  /* Steps */
  .step { flex-direction: column; gap: 0.75rem; }
  .step-number { align-self: flex-start; }

  /* Node parts – single column on small phones */
  .node-parts { grid-template-columns: 1fr; }

  /* Callout */
  .callout { flex-direction: column; gap: 0.5rem; padding: 1rem; }

  /* Tip box */
  .tip-box { padding: 1rem; }

  /* Prevent code overflow */
  code { word-break: break-all; }

  /* Buttons */
  .btn { width: 100%; justify-content: center; }
  .btn-small { width: auto; }
  .cta-center { max-width: 100%; }
}
