:root {
  /* side margin of the page: 200px from 1440px up, shrinks smoothly on smaller screens */
  --page-x: clamp(40px, 13.889vw, 200px);
  --bg: #0b0b0b;
  --white: #ffffff;
  --silver-300: #c2c2c2;
  --silver-500: #727272;
  --blue-700: #005eb6;
  --yellow-500: #ffd101;
}

.rv-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.rv-mask:has(img) {
  line-height: 0;
}

.rv-word {
  display: inline-block;
  will-change: transform;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

body {
  font-family: "Funnel Display", sans-serif;
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.squish-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  background: #ffffff;
  mix-blend-mode: difference;
  pointer-events: none;
  will-change: transform;
  display: none;
}

/* custom cursor only on devices with a mouse or trackpad, not on phones/tablets */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  .squish-cursor {
    display: block;
  }
}

.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* ---- Home ---- */

.home {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 28px var(--page-x) 0;
}

.home-header__id {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-header__name {
  margin: 0;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
}

.home-header__role {
  margin: 0;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--silver-300);
  max-width: 150px;
}

.home-header__role--mobile {
  display: none;
}

.home-header__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-link {
  font-weight: 300;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--silver-300);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.home-link:hover {
  color: var(--white);
}

.home-button {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.home-button:hover {
  border-bottom-color: var(--white);
}

.home-button__icon {
  display: block;
  width: 20px;
  height: 20px;
}

.home-mobile-tg {
  display: none;
}

.home-intro {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: clamp(40px, 9.93vw, 143px);
  padding: 0 var(--page-x);
  margin-top: 100px;
}

.home-intro__avatar {
  flex: none;
  width: 122px;
  height: 151px;
  overflow: hidden;
}

.home-intro__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
  display: block;
}

.home-intro__body {
  display: contents;
}

.home-intro__text {
  margin: 0;
  max-width: 510px;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
}

.home-mobile-links {
  display: none;
}

.home-flag {
  position: relative;
  display: inline-block;
  color: var(--bg);
}

/* two equal stripes sized in em, so they stay proportional at any font size
   (18px text -> 15x8px each, 22px text -> 18.3x9.8px each) */
.home-flag::before,
.home-flag::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 0.8333em;
  height: 0.445em;
  transform: translateX(-50%);
  z-index: -1;
}

.home-flag::before {
  top: 0.227em;
  background: var(--blue-700);
}

.home-flag::after {
  top: 0.672em;
  background: var(--yellow-500);
}

.home-cases {
  position: relative;
  z-index: 2;
  margin-top: 83px;
}

.home-cases__pin {
  display: flex;
  align-items: flex-start;
  padding-bottom: 120px;
  overflow: hidden;
}

.home-cases__track {
  display: flex;
  align-items: flex-start;
  width: max-content;
  padding-right: var(--page-x);
  will-change: transform;
}

.case-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: none;
  gap: 24px;
  will-change: transform, opacity;
}

.case-card__img {
  overflow: hidden;
  display: block;
}

.case-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.case-card:hover .case-card__img img {
  transform: scale(1.06);
}

.case-card--lg .case-card__img {
  width: 445px;
  height: 350px;
}

.case-card--sm .case-card__img {
  width: 245px;
  height: 245px;
}

.case-card__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
  white-space: nowrap;
}

.case-card__dot {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
  flex: none;
}

.case-card__dot-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: blur(1px);
}

.case-card__dot-center {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
}

.case-card--first .case-card__title {
  padding-left: var(--page-x);
}

.case-cloumi { margin-left: 0; }
.case-lume { margin-left: 20px; }
.case-inhouse { margin-left: 285px; }
.case-packpawer { margin-left: 20px; }
.case-scai { margin-left: 20px; }

.home-mobile-social {
  position: relative;
  z-index: 2;
  display: none;
}

.home-mobile-copy {
  position: relative;
  z-index: 2;
  display: none;
}

@media (max-width: 900px) {
  .home-header {
    position: sticky;
    top: 0;
    z-index: 40;
    flex-wrap: nowrap;
    padding: 16px;
    margin-bottom: -16px; /* keeps the gap to the first section unchanged */
    background: transparent;
    transition: background-color 0.2s ease;
  }

  /* background appears only once the page is scrolled (see header-scroll.js) */
  .home-header.is-scrolled {
    background: var(--bg);
  }

  .home-header__group,
  .home-button {
    display: none;
  }

  .home-mobile-tg {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 3px;
    right: 3px;
    width: 50px;
    height: 50px;
  }

  .home-mobile-tg img {
    display: block;
    width: 24px;
    height: 24px;
  }

  .home-header__name {
    font-size: 18px;
  }

  .home-header__role {
    font-size: 16px;
    max-width: none;
  }

  .home-header__role--mobile {
    display: block;
  }

  .home-intro {
    flex-direction: column;
    gap: 32px;
    padding: 0 16px;
    margin-top: 56px;
  }

  .home-intro__body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
  }

  .home-intro__text {
    max-width: none;
    font-size: 18px;
  }

  .home-intro__break {
    display: none;
  }

  .home-mobile-links {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .home-mobile-links__item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 0.03em;
    color: var(--white);
    white-space: nowrap;
  }

  .home-mobile-links__item img {
    display: block;
    width: 20px;
    height: 20px;
  }

  .home-cases {
    margin-top: 0;
    padding-top: 56px;
    padding-bottom: 0;
  }

  .home-cases__pin {
    position: static;
    height: auto;
    padding-bottom: 0;
  }

  .home-cases__track {
    flex-direction: column;
    width: 100%;
    gap: 20px;
    padding: 0 16px;
    transform: none !important;
  }

  .case-card,
  .case-cloumi,
  .case-lume,
  .case-inhouse,
  .case-packpawer,
  .case-scai {
    margin: 0;
    width: 100%;
  }

  .case-card--lg .case-card__img,
  .case-card--sm .case-card__img {
    width: 100%;
    height: 350px;
    aspect-ratio: auto;
  }

  .case-card__title {
    font-size: 16px;
  }

  .case-card--first .case-card__title {
    padding-left: 0;
  }

  .home-mobile-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 76px;
    padding: 0 16px;
  }

  .home-mobile-social--case {
    margin-top: 56px;
  }

  .home-mobile-social__email {
    font-weight: 300;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 0.03em;
    color: var(--white);
  }

  .home-mobile-social__icons {
    display: flex;
    align-items: center;
  }

  .home-mobile-social__icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
  }

  .home-mobile-social__icons img {
    display: block;
    width: 24px;
    height: 24px;
  }

  .home-mobile-copy {
    display: flex;
    justify-content: center;
    margin-top: 56px;
    padding: 0 16px 16px;
  }

  .copy-line {
    display: block;
  }

  .home-mobile-copy p {
    margin: 0;
    font-weight: 300;
    font-size: 14px;
    line-height: 1.3;
    letter-spacing: 0.03em;
    color: var(--silver-300);
    text-align: center;
  }
}

/* ---- Experience sidebar ---- */

.exp-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.exp-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.exp-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: 445px;
  max-width: 100%;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: rgba(114, 114, 114, 0.25);
  backdrop-filter: blur(17.5px);
  -webkit-backdrop-filter: blur(17.5px);
  transform: translateX(100%);
  transition: transform 0.4s ease;
}

.exp-sidebar.is-open {
  transform: translateX(0);
}

.exp-sidebar__close {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.exp-sidebar__close img {
  display: block;
  width: 24px;
  height: 24px;
}

.exp-sidebar__title {
  flex: none;
  margin: 15px 0 0 16px;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
}

.exp-sidebar__scroll {
  flex: 1;
  min-height: 0;
  margin-top: 56px;
  padding: 0 16px 56px;
  box-sizing: border-box;
  overflow-y: auto;
}

.exp-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 56px;
  max-width: 413px;
}

.exp-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.exp-card__date {
  flex: none;
  width: 83px;
  margin: 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
}

.exp-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exp-card__role {
  margin: 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
}

.exp-card__company {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exp-card__logo {
  flex: none;
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.exp-card__logo--icon {
  border-radius: 0;
}

.exp-card__company span {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
}

.exp-card__desc {
  margin: 0;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--white);
}

@media (max-width: 900px) {
  .exp-sidebar {
    width: 100%;
    height: 100dvh;
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* sticky dark header bar: title + close stay on top, the list scrolls below */
  .exp-sidebar__title {
    margin: 0;
    padding: 15px 16px;
    min-height: 50px;
    box-sizing: border-box;
    background: var(--bg);
  }

  .exp-sidebar__close {
    z-index: 1;
  }

  .exp-sidebar__scroll {
    margin-top: 0;
    padding-top: 41px; /* keeps the list where it was before */
  }
}

/* tablet and mobile: no text smaller than 16px */
@media (max-width: 1024px) {
  .exp-card__desc {
    font-size: 16px;
  }
}
