/* ===================================================
   Sweden SMP — Shared styles
   =================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Backgrounds */
  --bg: #0f1117;
  --bg-surface: #161922;
  --bg-card: #1a1e2b;
  --bg-card-hover: #1f2436;

  /* Text */
  --text-primary: #e8eaf0;
  --text-secondary: #8b90a0;
  --text-tertiary: #5a5f72;

  /* Accent colours */
  --accent-green: #34d058;
  --accent-green-glow: rgba(52, 208, 88, 0.15);
  --accent-red: #f85149;
  --accent-red-glow: rgba(248, 81, 73, 0.15);
  --accent-blue: #58a6ff;
  --accent-blue-glow: rgba(88, 166, 255, 0.12);
  --accent-yellow: #ffd166;
  --accent-cyan: #1fb6a8;

  /* Borders & glass */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --glass-bg: rgba(22, 25, 34, 0.70);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-glow-green: 0 0 20px rgba(52, 208, 88, 0.15);
  --shadow-glow-blue: 0 0 20px rgba(88, 166, 255, 0.15);

  /* Layout */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --container: 1100px;
  --header-height: 72px;
  --btn-height: 42px;
  --btn-font-size: 14px;

  /* Transitions */
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; scrollbar-gutter: stable; scroll-behavior: smooth; }
body {
  min-height: 100%;
  margin: 0;
  font-family: "Inter", system-ui, Arial, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(88, 166, 255, 0.03), transparent);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: transparent; cursor: pointer; }
:focus { outline: 3px solid rgba(88, 166, 255, 0.24); outline-offset: 3px; }

/* Dot-grid background overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout ---------- */
.site-container { max-width: var(--container); margin: 0 auto; padding: 0 20px; width: 100%; }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed; left: 12px; top: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text-primary);
  z-index: 9999; transform: translateY(-140%); transition: 180ms;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0;
  height: var(--header-height);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(15, 17, 23, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1200;
  transition: background 300ms, box-shadow 300ms;
}
.header.header-scrolled {
  background: rgba(15, 17, 23, 0.98);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 20px rgba(0, 0, 0, 0.5);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }

/* Prevent initial layout jump */
.header .nav-button,
.header .brand,
.header .logo,
.header .brand-text { transition: none !important; }
body.header-ready .header .nav-button,
body.header-ready .header .brand { transition: var(--transition) !important; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; line-height: 1; }
.brand a { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo { height: 36px; width: auto; display: inline-block; vertical-align: middle; }
.brand-text { color: var(--text-primary); font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; vertical-align: middle; line-height: 1; }

/* ---------- Desktop nav ---------- */
nav { display: flex; align-items: center; gap: 12px; }
.nav-list { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nav-button {
  padding: 0 16px;
  height: var(--btn-height);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-size: var(--btn-font-size);
  font-weight: 500;
  line-height: 1;
  transition: color var(--transition-fast), background var(--transition-fast),
              border-color var(--transition-fast), transform var(--transition-fast);
}
.nav-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
  transform: translateY(-1px);
}
.nav-button.active {
  color: var(--text-primary);
  background: rgba(52, 208, 88, 0.08);
  border-color: rgba(52, 208, 88, 0.15);
}

/* ---------- Hamburger ---------- */
.hamburger {
  display: none; width: 44px; height: 44px; border-radius: var(--radius-sm);
  align-items: center; justify-content: center; cursor: pointer;
  border: 1px solid var(--border-subtle); background: transparent;
}
.hamburger .bar { display: block; width: 20px; height: 2px; background: var(--text-secondary); position: relative; border-radius: 2px; transition: var(--transition-fast); }
.hamburger .bar::before, .hamburger .bar::after {
  content: ''; position: absolute; left: 0; width: 20px; height: 2px;
  background: var(--text-secondary); border-radius: 2px; transition: var(--transition);
}
.hamburger .bar::before { top: -6px; }
.hamburger .bar::after { bottom: -6px; }
body.nav-open .hamburger .bar { background: transparent; }
body.nav-open .hamburger .bar::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .hamburger .bar::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Mobile nav panel ---------- */
.nav-panel {
  position: fixed; left: 0; right: 0; top: var(--header-height);
  background: rgba(15, 17, 23, 0.98);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1150; padding: 16px 20px;
  display: none; flex-direction: column; gap: 8px; align-items: stretch;
}
body.nav-open .nav-panel { display: flex; animation: slideDown 200ms ease-out; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-panel a {
  display: block; padding: 14px 18px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-weight: 500; text-align: center;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}
.nav-panel a:hover, .nav-panel a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
}

/* ---------- Main content area ---------- */
main {
  padding-top: var(--header-height);
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: 1;
}

/* ---------- Section blocks (shared) ---------- */
.section-block {
  width: 100%; max-width: 1000px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-green);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.section-block:hover {
  border-left-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
}
.section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-header h2 {
  margin: 0; color: var(--text-primary);
  font-size: clamp(20px, 2.5vw, 26px); font-weight: 700; letter-spacing: -0.01em;
}
.section-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.section-icon--green { background: var(--accent-green-glow); color: var(--accent-green); }
.section-icon--blue  { background: var(--accent-blue-glow);  color: var(--accent-blue); }
.section-icon--red   { background: var(--accent-red-glow);   color: var(--accent-red); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 60px; padding: 32px 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  width: 100%;
}
.footer-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; text-align: center;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 14px;
}
.footer-logo { opacity: 0.6; }
.footer-links { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.footer-links a { color: var(--text-tertiary); transition: color var(--transition-fast); }
.footer-links a:hover { color: var(--accent-green); }
.footer-sep { color: var(--text-tertiary); opacity: 0.3; }
.footer-disclaimer {
  font-size: 11px; color: var(--text-tertiary); margin: 8px 0 0;
  max-width: 500px; line-height: 1.4;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.show { opacity: 1; transform: translateY(0); }

/* ---------- To-top button ---------- */
.to-top {
  position: fixed; right: 18px; bottom: 18px;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border-medium);
  color: var(--text-primary);
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); cursor: pointer; z-index: 1500;
  transition: transform var(--transition-fast), background var(--transition-fast);
}
.to-top:hover { transform: translateY(-2px); background: var(--bg-card-hover); }
.to-top.show { display: flex; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--bg-card); border: 1px solid var(--border-medium);
  color: var(--text-primary); padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px); opacity: 0; pointer-events: none;
  transition: 240ms ease; z-index: 2000;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav-list { display: none; }
  .hamburger { display: flex; }
  .site-container { padding: 0 16px; }
}
@media (max-width: 720px) {
  .section-block { padding: 16px; }
  .site-container { padding: 0 12px; }
  .header-inner { padding: 0 12px; }
  .brand-text { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
