/*
 * Custio landningssida – formgivning.
 *
 * Alla färger definieras som CSS-variabler på :root (ljust läge) och skrivs
 * över under prefers-color-scheme: dark. Komponenterna använder enbart
 * var(--...), aldrig hex inline. Kontrasten är kontrollerad mot WCAG AA i
 * båda lägena (se scripts/check-contrast.mjs).
 *
 * Primärfärgen #5D6BFF är Custios varumärkesfärg (samma theme-color som
 * Custio CS). Eftersom den inte når 4,5:1 mot vitt används en något mörkare
 * variant (--brand-strong) för knappar och länktext i ljust läge, och en
 * ljusare variant i mörkt läge.
 */

:root {
  color-scheme: light dark;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0ff;
  --text: #141830;
  --text-muted: #4f5572;
  --border: #dfe2ee;

  --brand: #5d6bff;
  --brand-strong: #4553eb;
  --brand-soft: #e9ebff;
  --on-brand: #ffffff;
  --accent: #f26b5e;

  --focus: #4553eb;
  --shadow: 0 10px 30px rgba(20, 24, 48, 0.08);
  --shadow-hover: 0 16px 40px rgba(20, 24, 48, 0.12);

  --radius: 20px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e111f;
    --surface: #161a2d;
    --surface-2: #1c2138;
    --text: #e9ebf7;
    --text-muted: #aab0cc;
    --border: #2a3050;

    --brand: #8b95ff;
    --brand-strong: #a3abff;
    --brand-soft: #232a4d;
    --on-brand: #0e111f;
    --accent: #ff8a7e;

    --focus: #a3abff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- Grund ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand-strong);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--brand-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-strong);
}

/* ---------- Knappar ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--brand-strong);
  color: var(--on-brand);
  box-shadow: 0 6px 18px rgba(93, 107, 255, 0.28);
}

.btn--primary:hover {
  box-shadow: 0 10px 24px rgba(93, 107, 255, 0.36);
}

.btn--secondary {
  background: transparent;
  color: var(--brand-strong);
  border-color: var(--brand-strong);
}

.btn--secondary:hover {
  background: var(--brand-soft);
}

/* ---------- Sidhuvud ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--bg);
  }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: -0.5rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
}

/* Loggan är en 1024x1024-bild med mycket luft runt ordbilden; den skalas
   upp något och beskärs via negativa marginaler så den ser balanserad ut. */
.brand__logo {
  height: 96px;
  width: auto;
  margin: -26px 0;
}

.site-nav {
  display: none;
  gap: 0.25rem;
  margin-left: auto;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.875rem;
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.site-nav__link:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.lang-toggle {
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.875rem;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.lang-toggle:hover {
  border-color: var(--brand-strong);
  color: var(--brand-strong);
}

@media (min-width: 720px) {
  .site-nav {
    display: flex;
  }
  .lang-toggle {
    margin-left: 0.5rem;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem);
  text-align: center;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 20% 0%, color-mix(in srgb, var(--brand) 22%, transparent) 0%, transparent 70%),
    radial-gradient(50% 45% at 85% 10%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 70%);
  pointer-events: none;
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hero__glow {
    background: radial-gradient(60% 50% at 20% 0%, rgba(93, 107, 255, 0.18) 0%, transparent 70%);
  }
}

.hero__title {
  max-width: 18ch;
  margin-inline: auto;
  font-size: clamp(2.125rem, 6vw, 3.75rem);
  font-weight: 800;
}

.hero__lead {
  max-width: 44rem;
  margin: 1.25rem auto 0;
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
}

/* ---------- Produktkort ---------- */

.products {
  display: grid;
  gap: 1.25rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  text-align: left;
}

@media (min-width: 760px) {
  .products {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

.product {
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product:hover {
  box-shadow: var(--shadow-hover);
}

.product__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.product__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.product__badge {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-strong);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product__title {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 800;
}

.product__tagline {
  margin-top: 0.375rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
}

.product__features {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.product__features li {
  position: relative;
  padding-left: 1.75rem;
}

.product__features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--brand-soft);
  /* Bock-ikon (lucide "check") som data-URI, färgas via mask */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") center / 60% no-repeat, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>") center / 60% no-repeat, linear-gradient(#000 0 0);
  mask-composite: exclude;
  background: var(--brand-strong);
}

.product__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: auto;
}

.product__actions .btn {
  flex: 1 1 100%;
}

.product__url {
  font-size: 0.9375rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 480px) {
  .product__actions .btn {
    flex: 0 0 auto;
  }
}

/* ---------- Sektioner ---------- */

.section {
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
}

.section--journey {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__title {
  max-width: 24ch;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
}

.section__lead {
  max-width: 44rem;
  margin-top: 1rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
}

/* ---------- Kundresan ---------- */

.journey {
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
  counter-reset: step;
}

@media (min-width: 860px) {
  .journey {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

.journey__step {
  position: relative;
  padding: 1.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.journey__step--handoff {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .journey__step--handoff {
    border-color: var(--brand);
  }
}

/* Pil mellan stegen: nedåt i stapel, åt höger i rad */
.journey__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1rem;
  width: 1rem;
  height: 1rem;
  transform: translate(-50%, 50%) rotate(45deg);
  border-right: 2px solid var(--brand-strong);
  border-bottom: 2px solid var(--brand-strong);
}

@media (min-width: 860px) {
  .journey__step:not(:last-child)::after {
    left: auto;
    right: -1.5rem;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) rotate(-45deg);
  }
}

.journey__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--brand-strong);
  color: var(--on-brand);
  font-weight: 800;
  font-size: 1rem;
}

.journey__title {
  font-size: 1.1875rem;
  font-weight: 700;
}

.journey__text {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.journey__loop {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--brand-strong);
}

.journey__loop-icon {
  flex: 0 0 auto;
}

.journey__note {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg);
  color: var(--text-muted);
}

/* ---------- Värdepunkter ---------- */

.values {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

@media (min-width: 640px) {
  .values {
    grid-template-columns: 1fr 1fr;
  }
}

.value {
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.value__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.value__title {
  font-size: 1.1875rem;
  font-weight: 700;
}

.value__text {
  margin-top: 0.5rem;
  color: var(--text-muted);
}

/* ---------- CTA ---------- */

.section--cta {
  padding-top: 0;
}

.cta {
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 4rem);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cta__title {
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  font-weight: 800;
}

.cta__text {
  max-width: 36rem;
  margin: 0.75rem auto 0;
  color: var(--text-muted);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* ---------- 404 ---------- */

.section--notfound {
  min-height: 60svh;
  display: flex;
  align-items: center;
}

.notfound {
  text-align: center;
}

.notfound__title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
}

.notfound__text {
  max-width: 36rem;
  margin: 1rem auto 0;
  color: var(--text-muted);
}

.notfound .cta__actions {
  margin-top: 2rem;
}

/* ---------- Sidfot ---------- */

.site-footer {
  padding: 2.5rem 0 calc(2.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 720px) {
  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .site-footer__copy {
    grid-column: 1 / -1;
  }
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-footer__logo {
  height: 80px;
  width: auto;
  margin: -22px -14px -22px -18px;
}

.site-footer__text {
  color: var(--text-muted);
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.5rem;
  color: var(--text);
  font-weight: 500;
}

.site-footer__nav a:hover {
  color: var(--brand-strong);
}

.site-footer__copy {
  color: var(--text-muted);
}

/* ---------- Intoning ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}
