/* Reset */
html {
  box-sizing: border-box;
  font-size: 16px;
  height: 100%;
  scroll-behavior: smooth;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.6;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
}

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

input,
button,
textarea,
select {
  font-family: inherit;
}

strong {
  font-weight: bolder;
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Theme / layout tokens */
:root {
  --color-primary: hsl(208, 100%, 38%);
  --color-primary-dark: hsl(208, 90%, 33%);
  --color-secondary: hsl(230, 64%, 90%);
  --color-secondary-dark: hsl(236, 37%, 18%);
  --color-success: #52b788;
  --color-negative: #ff4a47;

  --dark-hsl: 236, 37%, 15%;
  --color-dark: hsl(var(--dark-hsl));
  --color-dark-text: hsl(235, 15%, 35%);
  --color-dark-background: var(--color-dark);
  --color-dark-10: hsla(var(--dark-hsl), 0.1);

  --light-hsl: 240, 100%, 99%;
  --color-light: hsl(var(--light-hsl));
  --color-light-dark: hsl(240, 100%, 94%);
  --color-light-10: hsla(var(--light-hsl), 0.1);
  --color-logo-bg: var(--color-secondary);

  --font-default: 'Lato', sans-serif;
  --font-heading: 'Roboto Condensed', sans-serif;

  --hsl-color: var(--dark-hsl);
  --hsl-background: var(--light-hsl);
  --theme-color: var(--color-dark-text);
  --theme-background-color: var(--color-light);
  --theme-background-hover: var(--color-dark-10);
  --theme-highlight: var(--color-primary);
  --theme-highlight-inverse: var(--color-light);
  --theme-highlight-hover: var(--color-primary-dark);
  --theme-link-color: var(--color-primary);
  --theme-link-color-hover: var(--color-primary-dark);
}

[data-theme] {
  background-color: var(--theme-background-color);
  color: var(--theme-color);

  &[data-theme-status='inverted'] {
    background-color: var(--theme-color);
    color: var(--theme-background-color);
  }
}

[data-theme='light'] {
  --theme-color: var(--color-dark-text);
  --theme-background-color: var(--color-light);
  --theme-background-hover: var(--color-dark-10);
  --hsl-color: var(--dark-hsl);
  --hsl-background: var(--light-hsl);
}

[data-theme='dark'] {
  --theme-color: var(--color-light);
  --theme-background-color: var(--color-dark-background);
  --theme-background-hover: var(--color-light-10);
  --hsl-color: var(--light-hsl);
  --hsl-background: var(--dark-hsl);
  --theme-link-color: var(--color-light);
  --theme-link-color-hover: var(--color-light-dark);
}

[data-theme='secondary'] {
  --theme-color: var(--color-secondary-dark);
  --theme-background-color: var(--color-secondary);
  --theme-background-hover: var(--color-dark-10);
  --hsl-color: var(--dark-hsl);
  --hsl-background: var(--light-hsl);

  [data-theme='dark'] & {
    --theme-color: var(--color-secondary);
    --theme-background-color: var(--color-secondary-dark);
    --theme-background-hover: var(--color-light-10);
    --hsl-color: var(--light-hsl);
    --hsl-background: var(--dark-hsl);
  }
}

[data-theme='default'] {
  [data-theme='dark'] & {
    --theme-color: var(--color-light);
    --theme-background-color: var(--color-dark-background);
    --hsl-color: var(--light-hsl);
    --hsl-background: var(--dark-hsl);
  }

  [data-theme='light'] & {
    --theme-color: var(--color-dark-text);
    --theme-background-color: var(--color-light);
    --hsl-color: var(--dark-hsl);
    --hsl-background: var(--light-hsl);
  }
}

[data-theme='inverse'] {
  [data-theme='dark'] & {
    --theme-color: var(--color-dark-text);
    --theme-background-color: var(--color-light);
    --hsl-color: var(--dark-hsl);
    --hsl-background: var(--light-hsl);
    --theme-link-color: var(--color-primary);
    --theme-link-color-hover: var(--color-primary-dark);
  }

  [data-theme='light'] & {
    --theme-color: var(--color-light);
    --theme-background-color: var(--color-dark-background);
    --hsl-color: var(--dark-hsl);
    --hsl-background: var(--light-hsl);
    --theme-link-color: var(--color-light);
    --theme-link-color-hover: var(--color-light-dark);
  }
}

.skip-links {
  background-color: var(--theme-highlight);
  left: 50%;
  top: 0;
  padding: 1rem;
  max-height: 0;
  position: fixed;
  transform: translate(-50%, -100%) scale(0);
  transition: transform 0.3s;
  z-index: 1001;

  &:focus-within {
    transform: translate(-50%, 0%) scale(1);
    max-height: 100vh;
  }

  a,
  a:visited,
  a:hover,
  a:active,
  a:focus {
    display: inline-block;
    text-decoration: none;
    padding: 0.5rem;
    color: var(--theme-highlight-inverse);

    &:focus-visible {
      outline: none;
      box-shadow: none;
      background-color: var(--theme-highlight-hover);
    }
  }
}

#header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

#table-of-contents {
  transform: translateY(0);
  position: relative;
  padding: 1rem 0;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;

  &:not(:target) {
    padding: 0;
    transform: translateY(-200%);

    .table-of-contents {
      display: none;
    }
  }
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.logo-container {
  min-width: 5rem;
  width: min-content;
  background-color: var(--color-logo-bg);
  padding: 0.25rem 0.5rem;

  a {
    display: block;
  }

  img {
    display: block;
    height: 2.5rem;
  }
}

:focus-visible {
  outline: 1px solid var(--color-primary);
  box-shadow: 0 0 2px var(--color-primary);
}

.header-button {
  height: 2.5em;

  img {
    filter: invert(1);
  }
}

#footer {
  margin-top: 4rem;

  .nav-links {
    padding: 3rem 0;
  }
}

#main-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  font-size: 1.1rem;
  z-index: 999;

  .nav-links {
    border-radius: 0.5rem;
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
    --gap: 0.75rem;
  }

  .container {
    --container-width: 30rem;
  }
}

body.menu-active {
  overflow: hidden;

  #main-menu {
    display: flex;
    place-items: center;
  }
}

/* Composition */
.flow > * + * {
  margin-top: var(--gap, 1rem);
}

.flex-row {
  display: flex;
  gap: var(--row-gap, 0);
}

.flex-flow {
  display: flex;
  gap: var(--gap, 1rem);
}

.grid-flow {
  display: grid;
  gap: var(--gap, 1rem);
}

.grid-columns {
  grid-template-columns: repeat(auto-fit, minmax(var(--column-width, 20rem), 1fr));
}

.container {
  max-width: var(--container-width, 80rem);
  padding-left: var(--container-padding, 1rem);
  padding-right: var(--container-padding, 1rem);
  width: 100%;
  margin: 0 auto;
}

.full-center {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-success {
  color: var(--color-success);
}

.text-negative {
  color: var(--color-negative);
}

.text-highlight {
  color: var(--theme-highlight);
}

.items-center {
  align-items: center;
}

.lead {
  line-height: 1.2;
  font-size: 1.2rem;
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  font-weight: 400;

  strong {
    font-weight: inherit;
  }
}

h1 + .lead {
  margin-top: 1.5rem;
}

/* Actions / links */
a,
.link {
  color: var(--theme-link-color);
  text-decoration: underline;
  border: none;
  background-color: transparent;
  font-size: inherit;
  line-height: inherit;

  &:visited {
    color: var(--theme-link-color);
  }

  &:hover,
  &:active,
  &:focus {
    color: var(--theme-link-color-hover);
  }
}

.action,
.action:visited {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 0.1em solid var(--action-border-color, var(--theme-color));
  color: var(--action-color, var(--theme-color));
  background-color: var(--action-background-color, transparent);
  margin: 0;
  padding: 0.25em 1em;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  border-radius: 0.25em;
  transition: all 0.3s ease;
  letter-spacing: 0;

  &[data-type='primary'] {
    --action-color: var(--theme-highlight-inverse);
    --action-border-color: var(--theme-highlight);
    --action-background-color: var(--theme-highlight);
    --action-color-hover: var(--theme-highlight-inverse);
    --action-border-color-hover: var(--theme-highlight-hover);
    --action-background-color-hover: var(--theme-highlight-hover);
  }
}

.action:focus,
.action:hover {
  text-decoration: none;
  border-color: var(--action-border-color-hover, var(--theme-color));
  background-color: var(--action-background-color-hover, var(--theme-color));
  color: var(--action-color-hover, var(--theme-background-color));
}

/* Hero (shared) + shared media variants used on more than one page */
.main-hero {
  padding: 15% 10%;
  display: flex;
  background-color: var(--theme-background-color);
  color: var(--theme-color);
  overflow: hidden;
  position: relative;
  z-index: 0;

  .title {
    font-size: 2rem;
    font-size: clamp(1.2rem, 7.5vw, 4rem);
    max-width: 12em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    opacity: 0.5;
  }

  .subtitle {
    margin: 1em 0 0;
    font-size: 1.5rem;
    line-height: 1.2;
    font-size: clamp(1.1rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    max-width: 15em;
  }

  .actions {
    display: grid;
    gap: 1em;
    margin-top: 2em;

    @media screen and (min-width: 900px) {
      margin-top: 3em;
      grid-template-columns: repeat(auto-fit, minmax(40%, 1fr));
    }
  }

  .action {
    font-size: 1.2rem;
    line-height: 1.2;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    padding: 0.5em 1em;
  }

  .content {
    min-width: 66.66%;
  }

  .media {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: -1;
    opacity: 0.15;

    @media screen and (min-width: 900px) {
      opacity: 1;
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }

  @media screen and (min-width: 900px) {
    &.main-hero-right {
      justify-content: end;
    }

    .media-right {
      left: 50%;
      opacity: 0.7;
    }

    .media-left {
      right: 50%;
      opacity: 0.7;

      &.media-web img {
        transform: scale(1.2) translateX(-12%);
      }
    }

    .media-web img {
      transform: scale(1.4) translateX(5%) rotateY(180deg);
    }

    .media-emarketing img {
      transform: scale(1.2) translateX(15%);
    }
  }
}

/* Blocks */
.glassmorph {
  box-shadow: 1rem 1rem 3rem -1rem rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(2px) saturate(0.5) opacity(1);
}

.alert {
  padding: 0.5em 1em;
  border: 0.2em solid currentColor;
  border-radius: 0.5em;
}

.nav-links {
  letter-spacing: 0.1em;
  --gap: 0.125rem;

  a {
    display: block;
    padding: 0 0.5rem;
    text-decoration: none;

    &:hover {
      background-color: var(--theme-background-hover);
    }
  }

  .title {
    font-size: 120%;
    font-weight: 700;

    ~ a {
      color: inherit;
    }
  }
}

.section {
  padding: 4rem 0;
  font-size: 1.1rem;
  line-height: 1.675;
  letter-spacing: 0.05em;

  + .section {
    margin-top: 4rem;
  }

  h1,
  h2 {
    line-height: 1;
    font-size: 2rem;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 4rem;
  }
}

.section-legal {
  font-size: 1rem;

  h1,
  h2 {
    margin: 0;
    font-weight: 700;
  }

  p {
    margin: 0;
  }

  li {
    list-style: disc;
    list-style-position: inside;

    + li {
      margin-top: 0.5rem;
    }
  }

  h1 {
    font-size: 1.5rem;
    margin: 0;
  }

  h2 {
    font-size: 1.2rem;
    margin: 0;
  }

  .container {
    display: grid;
    gap: 1rem;
  }
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 0.25rem;
  margin: 0;
  width: 100%;
}

.breadcrumb-item {
  font-size: 0.85em;
  padding: 0 0 0 0.25em;
  margin: 0;
  list-style: none;

  + .breadcrumb-item::before {
    display: inline-block;
    padding-right: 0.25rem;
    content: '>';
  }
}

.faq {
  h3 {
    margin-top: 2rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
  }

  dl {
    margin-top: 1rem;
  }
}

.card-list {
  width: 100%;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.box {
  padding: 0.75rem;
  border-radius: 0.75rem;
}

.media-description {
  display: grid;
  gap: 2rem;

  + .media-description {
    margin-top: 2rem;
  }

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

@media screen and (min-width: 900px) {
  .media-description {
    grid-template-columns: repeat(2, 1fr);
  }

  .media-description--2-3 {
    grid-template-columns: 2fr 3fr;
  }

  .media-description--3-2 {
    grid-template-columns: 3fr 2fr;
  }
}

.card {
  padding: 0.75rem;
  border-radius: 0.75rem;
  transition: all 300ms;
  display: grid;
  gap: 1rem;
  grid-template-rows: auto auto 1fr auto;

  h2,
  h3 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.2em;
  }

  p {
    margin: 0;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    opacity: 0.75;
    line-height: 1.75;
  }

  .actions {
    display: grid;
    gap: 1em;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  }

  &:hover {
    transform: translateY(-0.125rem);
    z-index: 1;

    .card__cover img {
      transform: scale(1.05);
    }
  }
}

.card__cover {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 0.5rem;
  overflow: hidden;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 300ms;
  }
}

.card__footer {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.hamburger-bar {
  position: relative;
  height: 0.15em;
  width: 1.75em;
  display: block;
  background-color: currentColor;
  transition: all 0.1s linear;
  top: -0.625em;
  transform-origin: top left;

  &::after,
  &::before {
    content: '';
    background-color: currentColor;
    position: absolute;
    width: 100%;
    height: 0.15em;
    left: 0;
    transform-origin: top left;
  }

  &::after {
    top: 800%;
    transition: all 0.1s linear;
  }

  &::before {
    top: 400%;
  }

  .active > & {
    left: 0.33em;
    transform: rotateZ(45deg);

    &::after {
      left: 0.75em;
      top: 600%;
      transform: rotateZ(-90deg);
    }

    &::before {
      opacity: 0;
    }
  }
}

.accordion {
  box-shadow: 1rem 1rem 2rem -1rem rgba(0, 0, 0, 0.1);
  background-color: var(--theme-background-color);
  border-radius: 0.25rem;
}

.accordion__label {
  padding: 1em 1.5em;
  display: block;
  color: var(--theme-highlight-inverse);
  cursor: pointer;
  position: relative;
  background-color: var(--theme-highlight);
  transition: background-color 300ms;

  &:hover {
    background-color: var(--theme-highlight-hover);
  }

  &::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1.5em;
    width: 1em;
    height: 1em;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="50" xmlns="http://www.w3.org/2000/svg"><polygon points="0,0 100,0 50,50" style="fill:%23FFFFFF;" /></svg>');
    background-size: contain;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    transition: transform 0.25s;
  }
}

.accordion__content {
  background-color: var(--theme-background-color);
  max-height: 0;
  padding: 0 1.5em;
  overflow: hidden;
  transition: max-height 0.2s ease-out, padding 0.2s;
}

.accordion__item {
  position: relative;
}

.accordion__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  outline: none;

  &:focus ~ .accordion__label {
    background-color: var(--theme-highlight-hover);
  }

  &:checked {
    ~ .accordion__content {
      max-height: 100vh;
      padding: 1em 1.5em;
    }

    ~ .accordion__label::after {
      transform: translateY(-50%) rotate(0.5turn);
    }
  }
}

.table-of-contents {
  list-style: none;
  margin: 0.25rem 0;
  padding: 0;

  .table-of-contents {
    margin-left: 1rem;
  }
}

/* Base typography / site chrome */
dl {
  margin: 1em 0 0;

  dt {
    font-weight: 600;
    font-size: 120%;
    margin: 0;
  }

  dd {
    margin: 0.25em 0 0.25em 0.5em;

    + dt {
      margin-top: 1em;
    }
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 300;
  font-family: var(--font-heading);
}

p {
  margin: 1em 0 0;
}

.section:target::before,
.section :target:not(.card)::before {
  content: '';
  display: block;
  height: 6rem;
}

body {
  font-family: var(--font-default);
  font-weight: 400;
  margin: 0;
  font-size: 1rem;
  min-height: 100%;
  line-height: 1.6;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

#accept-cookies {
  display: none;
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;

  a {
    text-decoration: underline;
  }

  .cookies-not-accepted & {
    display: block;
  }
}
