*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #E8401C;
  --orange-hover: #c93314;
  --dark: #1a1a1a;
  --gray: #6b7280;
  --light-gray: #f5f5f5;
  --border: #e5e7eb;
  --white: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
  font-size: 16px;
}

/* ── NAVBAR ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--dark);
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: var(--dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark svg { width: 22px; height: 22px; fill: white; }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark);
  font-size: 0.95rem;
  font-weight: 450;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--orange); }

.nav-cta {
  background: var(--orange);
  color: white !important;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600 !important;
  transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--orange-hover) !important; color: white !important; }

/* ── HERO ── */
#hem {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #fff8f6 0%, #fde8e1 50%, #fdf0e8 100%);
  padding: 5rem 2.5rem;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.hero-text h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-text h1 span { color: var(--orange); }

.hero-text p {
  font-size: 1.05rem;
  color: #4b5563;
  margin-bottom: 2rem;
  max-width: 440px;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  background: var(--orange);
  color: white;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--orange-hover); }

.btn-secondary {
  background: var(--white);
  color: var(--dark);
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--dark); }

/* Code snippet visual */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-card {
  background: #1e1e2e;
  border-radius: 14px;
  padding: 1.75rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
}

.code-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 1.25rem;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }

.c-comment { color: #6c7086; }
.c-keyword  { color: #cba6f7; }
.c-string   { color: #a6e3a1; }
.c-var      { color: #89b4fa; }
.c-fn       { color: #fab387; }
.c-num      { color: #f38ba8; }
.c-plain    { color: #cdd6f4; }

/* ── STATS STRIP ── */
.stats-strip {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 2.5rem;
}

.stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-label { font-size: 0.9rem; color: var(--gray); }

/* ── FUNKTIONER ── */
#funktioner {
  padding: 6rem 2.5rem;
  background: var(--light-gray);
}

.section-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 0.75rem;
}

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-sub {
  text-align: center;
  color: var(--gray);
  max-width: 560px;
  margin: 0 auto 3.5rem;
  font-size: 0.98rem;
}

.features-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: var(--orange);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.feature-icon svg { width: 26px; height: 26px; fill: white; }

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.feature-card p { font-size: 0.88rem; color: var(--gray); line-height: 1.6; }

/* ── ENDPOINT PREVIEW ── */
#endpoints {
  padding: 6rem 2.5rem;
  background: var(--white);
}

.endpoint-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.endpoint-list {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.endpoint-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  background: var(--white);
  transition: background 0.15s;
  user-select: none;
}
.endpoint-header:hover { background: #fafafa; }

.method {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 4px;
  min-width: 54px;
  text-align: center;
}
.method-get  { background: #dbeafe; color: #1d4ed8; }
.method-post { background: #dcfce7; color: #15803d; }
.method-del  { background: #fee2e2; color: #b91c1c; }

.endpoint-path {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  color: var(--dark);
  flex: 1;
}

.endpoint-desc { font-size: 0.85rem; color: var(--gray); }

.endpoint-chevron {
  width: 18px;
  height: 18px;
  color: var(--gray);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.endpoint-item.open .endpoint-chevron { transform: rotate(180deg); }

.endpoint-body {
  display: none;
  padding: 1.25rem 1.5rem;
  background: #1e1e2e;
  border-top: 1px solid var(--border);
}
.endpoint-item.open .endpoint-body { display: block; }

.endpoint-body pre {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: #a6e3a1;
  white-space: pre-wrap;
  line-height: 1.7;
}

/* ── FAQ ── */
#faq {
  padding: 6rem 2.5rem;
  background: var(--light-gray);
}

.faq-list {
  max-width: 760px;
  margin: 3rem auto 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  gap: 1rem;
  user-select: none;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.25s;
  color: var(--gray);
}
.faq-item.open .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  font-size: 0.92rem;
  color: var(--gray);
  line-height: 1.7;
}
.faq-item.open .faq-answer {
  max-height: 400px;
  padding-bottom: 1.25rem;
}

/* ── KONTAKT ── */
#kontakt {
  padding: 6rem 2.5rem;
  background: var(--white);
}

.contact-card {
  max-width: 580px;
  margin: 3rem auto 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
}

.contact-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.contact-card .sub {
  font-size: 0.9rem;
  color: var(--gray);
  margin-bottom: 2rem;
}
.contact-card .sub a { color: var(--orange); text-decoration: none; }
.contact-card .sub a:hover { text-decoration: underline; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.93rem;
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #9ca3af; }

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232,64,28,0.1);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-submit {
  width: 100%;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font);
}
.form-submit:hover { background: var(--orange-hover); }

.form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--gray);
}
.form-footer a { color: var(--orange); text-decoration: none; }

.form-success {
  display: none;
  text-align: center;
  padding: 1.5rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 10px;
  color: #15803d;
  font-weight: 600;
  margin-top: 1rem;
}

.form-error {
  display: none;
  text-align: center;
  padding: 1.5rem;
  background: #f8acac;
  border: 1px solid #b91c1c;
  border-radius: 10px;
  color: #b91c1c;
  font-weight: 600;
  margin-top: 1rem;
}

/* ── FOOTER ── */
footer {
  background: var(--light-gray);
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy { font-size: 0.85rem; color: var(--gray); }

.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--gray);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--orange); }

/* ── HAMBURGER BUTTON ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 200;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span { background: var(--dark); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── RESPONSIVE ── */
@media (max-width: 800px) {
  /* Nav – ta bort backdrop-filter så att fixed children fungerar */
  nav {
    backdrop-filter: none;
    background: var(--white);
  }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #f9f9f9;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0;
    z-index: 150;
    padding: 0.5rem 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    font-size: 0.95rem;
    color: var(--dark);
    padding: 0.85rem 1.75rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-links a:hover { color: var(--orange); background: #f0f0f0; }
  .nav-links .nav-cta {
    display: block;
    margin: 0.75rem 1.75rem;
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    text-align: center;
    color: #ffffff !important;
    border-bottom: none !important;
    border-radius: 8px;
  }
  .nav-links .nav-cta:hover { background: var(--orange-hover) !important; }

  /* Hero */
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-visual { order: -1; }

  /* Stats */
  .stats-inner { grid-template-columns: 1fr; gap: 1.5rem; }

  /* Features */
  .features-grid { grid-template-columns: 1fr 1fr; }

  /* Endpoints – hide description on medium screens */
  .endpoint-desc { display: none; }
}

@media (max-width: 560px) {
  /* Nav */
  nav { padding: 0 1.25rem; }

  /* Sections */
  #hem       { padding: 3rem 1.25rem; min-height: auto; }
  #funktioner,
  #faq,
  #kontakt,
  #endpoints { padding: 3.5rem 1.25rem; }
  .stats-strip { padding: 2rem 1.25rem; }

  /* Hero */
  .hero-text h1 { font-size: 1.75rem; }
  .hero-text p  { font-size: 0.95rem; }
  .hero-actions { flex-direction: column; }
  .btn-primary,
  .btn-secondary { width: 100%; text-align: center; }

  /* Code card */
  .code-card { font-size: 0.74rem; padding: 1.25rem; }

  /* Features */
  .features-grid { grid-template-columns: 1fr; }

  /* Endpoints */
  .endpoint-header { padding: 0.9rem 1rem; gap: 0.6rem; }
  .endpoint-path   { font-size: 0.78rem; }
  .endpoint-body   { padding: 1rem; }
  .endpoint-body pre { font-size: 0.74rem; }

  /* FAQ */
  .faq-question { font-size: 0.93rem; }

  /* Contact */
  .contact-card { padding: 1.5rem 1.1rem; }

  /* Footer */
  .footer-inner   { flex-direction: column; text-align: center; }
  .footer-links   { flex-wrap: wrap; justify-content: center; }
}
