/*
 * RESET
 ———————————————————————————————————————————————
 */

::selection {
  background: var(--akzent-color);
  text-shadow: none;
  color: var(--bg);
}

audio,
canvas,
img,
video {
  vertical-align: middle;
}

html, body,
h1, h2, h3, h4,
p, ul, li, strong,
header, nav, main, section, footer {
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

/*
 * SETTINGS
 ———————————————————————————————————————————————
 */

html {
  scroll-behavior: smooth;
}

:root {
  /* Colors */
  --text:    #32341A;
  --bg:      #F2F6FE;
  --akzent:  #344bfe;

  --text-color:   var(--text);
  --bg-color:     var(--bg);
  --akzent-color: var(--akzent);

  /* Grid */
  --grid-columns: 3;
  --grid-gutter:  2rem;
  --grid-margin:  2rem;
  --grid-max:     1440px;

  /* Spacing */
  --v-space: 5vh;
}

@media screen and (min-width: 768px) {
  :root {
    --grid-columns: 7;
    --grid-margin:  4rem;
  }
}

/*
 * TYPOGRAPHY
 ———————————————————————————————————————————————
 */

@font-face {
  font-family: 'SL-Grotesk';
  src: url('font/ESKlarheitGrotesk-Book.woff2') format('woff2'),
       url('font/ESKlarheitGrotesk-Book.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html,
body, h1, p {
  font-family: 'SL-Grotesk', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 500;
  font-size: 1em;
  text-rendering: optimizeLegibility;
}

/*
 * COLORS
 ———————————————————————————————————————————————
 */

html {
  color: var(--text-color);
  background-color: var(--bg-color);
}

/*
 * LINKS
 ———————————————————————————————————————————————
 */

a,
a:visited {
  color: var(--text-color);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-color);
  padding: .15em 0;
  background-image: linear-gradient(var(--text-color), var(--text-color));
  background-size: 0% 100%;
  background-repeat: no-repeat;
  background-position: left;
  transition: background-size .25s ease, color .25s ease;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

a:hover,
a:active {
  color: var(--bg-color);
  background-size: 100% 100%;
}

/*
 * LAYOUT
 ———————————————————————————————————————————————
 */

/* Hero — 100vh */
.hero {
  position: relative;
  width: 100%;
  height: 115vh;
  overflow-x: clip;
  overflow-y: visible;
  padding: 0;
  animation: hero-in 1s ease-out both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(10vh); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-text {
  position: absolute;
  top: 33%;
  left: var(--grid-margin);
  transform: translateY(-50%);
  z-index: 10;
  opacity: 0;
  animation: fade-in .75s ease-out 1s both;
}

.hero-text p {
  margin: 0;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Hero layers — stacking order: bg → cloud-back → fg → cloud-front → text */
.hero-bg,
.hero-fg {
  position: absolute;
  width: 100%;
  height: 100vh;
  background-repeat: no-repeat;
}

.hero-bg {
  z-index: 1;
  background-image: url('../media/SL-Hero-BG.webp');
  background-position: center center;
  background-size: cover;
}

.cloud-back {
  z-index: 2;
}

/* Solid colour plane — moves with FG, blocks BG bleed-through during parallax */
.hero-cover {
  position: absolute;
  width: 100%;
  top: 75%;
  bottom: 0;
  z-index: 2;
  background: var(--bg-color);
}

.hero-fg {
  z-index: 3;
  background-image:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 72%,
      rgba(242, 246, 254, 0.4) 80%,
      rgba(242, 246, 254, 0.75) 87%,
      var(--bg-color) 95%
    ),
    url('../media/SL-Hero-FG.webp');
  background-position: bottom, center center;
  background-size: 100%, cover;
}

.cloud-front {
  z-index: 4;
}

/* Cloud layers — PNG drift */
.cloud {
  position: absolute;
  width: 200%;
  height: 100%;
  background-repeat: repeat-x;
  background-size: 50% auto;
  pointer-events: none;
}

.cloud-back {
  z-index: 2;
  top: -10%;
  background-image: url('../media/Cloud(12).webp');
  background-position: center 40%;
  background-size: 50% auto;
  opacity: 0.6;
  animation: drift 120s linear infinite;
}

.cloud-mid {
  z-index: 6;
  bottom: -40%;
  background-image: url('../media/Cloud(10).webp');
  background-position: center top;
  background-size: 50% auto;
  opacity: 0.9;
  animation: drift 80s linear infinite;
}

.cloud-front {
  z-index: 7;
  bottom: -55%;
  background-image: url('../media/Cloud(9).webp');
  background-position: center top;
  background-size: 50% auto;
  animation: drift 60s linear infinite;
}

@keyframes drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}


/* Content Grid */
.content-grid {
  --_margin: var(--grid-margin);
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  max-width: var(--grid-max);
  margin-inline: auto;
  padding-inline: var(--_margin);
}

/* Content — main */
main {
  position: relative;
  z-index: 5;
  background: var(--bg-color);
  padding-top: 0;
  padding-bottom: var(--v-space);
}

main > * {
  grid-column: 1 / -1;
}

main p {
  margin-bottom: 1em;
  grid-column: 1 / -1;
}

@media screen and (min-width: 768px) {
  main p {
    grid-column: 3 / 6;
  }
}

main .lead {
  padding-top: 2em;
}

main .before-logos {
  margin-top: 10rem;
}

main .after-logos {
  margin-top: 5rem;
}

main .before-footer {
  margin-top: 5rem;
}

/* Logo Grid */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  gap: var(--grid-gutter);
  align-items: center;
  margin: 2em 0 3em;
  grid-column: 1 / -1;
}

.logo-grid a {
  border: none;
  background: none;
  padding: 0;
}

.logo-grid img {
  width: 100%;
  object-fit: contain;
  transition: opacity .6s ease-out;
}

.logo-grid a:hover img {
  opacity: 1 !important;
  transition: opacity .1s ease;
}

@media screen and (min-width: 768px) {
  .logo-grid img {
    padding-inline: 1rem;
  }
}


/* Footer — 100vh */
footer {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding-block-start: var(--v-space);
  padding-block-end: 0;
  align-items: start;
  align-content: start;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: .5em;
  padding-top: 15vh;
  position: relative;
  z-index: 5;
  grid-column: 1 / -1;
}

.footer-contact a {
  width: fit-content;
}

@media screen and (min-width: 768px) {
  .footer-contact {
    grid-column: 3 / 6;
  }
}

.footer-img {
  position: absolute;
  width: 100vw;
  height: 100%;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  background-image: url('../media/SL-Footer.webp');
  background-position: center 40%;
  background-size: cover;
}


/*
 * DEBUG GRID
 ———————————————————————————————————————————————
 */

.debug-grid {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  column-gap: var(--grid-gutter);
  max-width: var(--grid-max);
  margin-inline: auto;
  padding-inline: var(--grid-margin);
  opacity: 0;
  transition: opacity .15s ease;
}

.debug-grid.visible {
  opacity: 1;
}

.debug-grid span {
  background: rgba(255, 0, 0, .07);
  border-inline: 1px solid rgba(255, 0, 0, .2);
  height: 100%;
}

/* Hide extra spans on mobile (3 cols) */
.debug-grid span:nth-child(n+4) {
  display: none;
}

@media screen and (min-width: 768px) {
  .debug-grid span:nth-child(n+4) {
    display: block;
  }
  .debug-grid span:nth-child(n+8) {
    display: none;
  }
}

/*
 * UTILITY
 ———————————————————————————————————————————————
 */

.hidden {
  display: none !important;
  visibility: hidden;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
