/* Pixel och Kod – stilmall. Tokens enligt pixel-och-kod-profil/farger-och-typografi.json */

/* Typsnitt */
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Raleway'; src: url('../fonts/Raleway-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Nunito Sans'; src: url('../fonts/NunitoSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Nunito Sans'; src: url('../fonts/NunitoSans-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Nunito Sans'; src: url('../fonts/NunitoSans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/JetBrainsMono-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

/* Tokens */
:root {
  --surface-100: #FFFFFF;
  --surface-200: #F3F6FA;
  --surface-300: #E3E9F0;
  --ink: #0F3657;
  --ink-muted: #4A5F75;
  --brand: #0F3657;
  --on-brand: #FFFFFF;
  --link: #1A6FA3;
  --accent: #F89B23;
  --on-accent: #0F3657;
  --border-control: #6F859B;
  --border-subtle: #E3E9F0;
  --focus: #1A6FA3;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  --shadow-card: 0 1px 2px #0f365726, 0 4px 12px #0f36571a;

  --font-display: 'Raleway', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Nunito Sans', 'Segoe UI', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --surface-100: #0B1F33;
  --surface-200: #11304D;
  --surface-300: #1B3F63;
  --ink: #F2F6FA;
  --ink-muted: #A9BCCF;
  --brand: #5CBBEA;
  --on-brand: #0B1F33;
  --link: #6CC3F0;
  --on-accent: #0B1F33;
  --border-control: #6F8DAA;
  --border-subtle: #1B3F63;
  --focus: #6CC3F0;

  color-scheme: dark;
}

/* Grund */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body, h1, h2, h3, h4, p, pre { margin: 0; }
img, svg { display: block; max-width: 100%; }

body {
  background: var(--surface-100);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-variant-numeric: lining-nums;
  color: inherit;
}
h2 { font-size: 30px; line-height: 38px; font-weight: 800; }
h3 { font-size: 22px; line-height: 30px; font-weight: 700; }

p { max-width: 65ch; }

a { color: var(--link); text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Knappar */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: color-mix(in srgb, var(--brand) 88%, var(--ink-muted)); }
.btn--secondary { color: var(--ink); border-color: var(--border-control); }
.btn--secondary:hover { background: var(--surface-300); }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--accent:hover { background: #F17C2C; }

/* Sidhuvud */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface-100);
  border-bottom: 1px solid var(--border-subtle);
}
.site-header .container {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 72px;
}
.logo-link { display: block; margin-right: auto; padding-block: var(--space-2); }
.logo-link img { width: 160px; height: auto; }
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

.nav-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.nav-toggle:hover,
.theme-toggle:hover { background: var(--surface-300); }

.nav-toggle {
  flex-direction: column;
  gap: 4px;
  order: 3;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-100);
  border-bottom: 1px solid var(--border-subtle);
}
.nav.is-open { display: block; }
.nav__list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) var(--space-4) var(--space-4);
}
.nav__list a {
  display: block;
  padding: var(--space-3) 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.nav__list a:hover { color: var(--link); text-decoration: underline; }

@media (min-width: 760px) {
  .container { padding-inline: var(--space-5); }
  .nav-toggle { display: none; }
  .nav {
    display: block;
    position: static;
    border: 0;
    background: none;
  }
  .nav__list {
    display: flex;
    gap: var(--space-5);
    padding: 0;
  }
  .nav__list a { padding: var(--space-2) 0; }
  .logo-link img { width: 180px; }
}

/* Hero */
.hero { padding-block: var(--space-7) var(--space-8); }
.hero > .container {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}
.hero__content .label { margin-bottom: var(--space-4); }
.hero h1 {
  font-size: 38px;
  line-height: 44px;
  font-weight: 800;
  max-width: 14ch;
  margin-bottom: var(--space-5);
}
.hero__text {
  font-size: 18px;
  line-height: 28px;
  color: var(--ink-muted);
  margin-bottom: var(--space-6);
}
.hero__buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.hero__image { width: 100%; max-width: 320px; }
.hero-pattern { width: 100%; height: auto; }

@media (min-width: 760px) {
  .hero { padding-block: var(--space-9); }
  .hero h1 { font-size: 56px; line-height: 60px; }
  .hero > .container { grid-template-columns: 1.4fr 1fr; gap: var(--space-8); }
  .hero__image { max-width: 420px; justify-self: end; }
}

/* Pixelband */
.pixel-band {
  height: 80px;
  background: url('../assets/pixelmonster_band.svg') center / auto 100% no-repeat;
}
.pixel-band--small { height: 40px; margin-bottom: var(--space-5); }

/* Sektioner */
.section { padding-block: var(--space-7); }
.section--alt { background: var(--surface-200); }
.section h2 { margin-bottom: var(--space-3); }
.section__intro {
  font-size: 18px;
  line-height: 28px;
  color: var(--ink-muted);
  margin-bottom: var(--space-6);
}
#tjanster h2 { margin-bottom: var(--space-6); }

@media (min-width: 760px) {
  .section { padding-block: var(--space-8); }
}

/* Kort */
.grid { display: grid; gap: var(--space-5); }
@media (min-width: 760px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--surface-100);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.section--alt .card { box-shadow: var(--shadow-card); border-color: transparent; }
[data-theme="dark"] .section--alt .card { box-shadow: none; border-color: var(--surface-300); }

.card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: var(--surface-200);
  border-radius: var(--radius-md);
}
.card h3 { font-size: 18px; line-height: 26px; }
.card p { color: var(--ink-muted); }
.card--product p { flex: 1; }

.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-2);
  background: var(--surface-300);
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.card__link { font-weight: 700; }
.card__soon { font-size: 14px; line-height: 22px; color: var(--ink-muted); }

/* Om oss */
.about { display: grid; gap: var(--space-6); align-items: center; }
.about__text p + p { margin-top: var(--space-4); }
.about__text h2 { margin-bottom: var(--space-4); }
.code-card {
  background: var(--surface-100);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  overflow-x: auto;
}
.code-card code {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
  color: var(--ink);
}
@media (min-width: 1024px) {
  .about { grid-template-columns: 1.2fr 1fr; gap: var(--space-8); }
}

/* Kontakt */
.section--brand {
  position: relative;
  overflow: hidden;
  background: var(--brand);
  color: var(--on-brand);
}
.section--brand .container { position: relative; }
.section--brand p { margin-bottom: var(--space-6); font-size: 18px; line-height: 28px; }
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}
.contact__email { font-family: var(--font-mono); font-size: 14px; }
.contact__pattern {
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 30%;
  max-width: 280px;
  pointer-events: none;
}
@media (max-width: 759px) {
  /* På smal skärm skulle hörnmotivet hamna bakom texten */
  .contact__pattern { display: none; }
}

/* Sidfot */
.site-footer {
  padding-block: var(--space-6);
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 22px;
}
.site-footer p { max-width: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Innehåll från admin */
.tag { text-transform: uppercase; }
.card__image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-md); }

/* Kontaktformulär */
.contact-form { display: grid; gap: var(--space-4); max-width: 560px; margin-bottom: var(--space-5); }
.contact-form .form-group { display: grid; gap: var(--space-1); }
.contact-form label { font-weight: 700; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: var(--space-3);
  font: inherit;
  color: var(--ink);
  background: var(--surface-100);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-md);
}
.contact-form button { justify-self: start; }
.section--brand .contact-form :focus-visible,
.section--brand .btn:focus-visible,
.section--brand a:focus-visible { outline-color: var(--on-brand); }
.section--brand .contact__alt a { color: var(--on-brand); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status {
  max-width: 560px;
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-100);
  color: var(--ink);
  border-left: 4px solid #1E7A4C;
  border-radius: var(--radius-md);
}
.form-status--error { border-left-color: #B3321A; }
