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

html,
body {
  height: 100%;
}

:root {
  --page-side-padding: max(
    clamp(16px, 3vw, 40px),
    env(safe-area-inset-left),
    env(safe-area-inset-right)
  );
  --main-scale: clamp(32px, calc((100vw - (var(--page-side-padding) * 2)) * 0.13), 220px);
}

body {
  font-family: "Funnel Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e5e8eb;
  color: #000;
  overflow: hidden;
  min-height: 100svh;
  min-height: 100dvh;
}

/* Page layout: fixed top/bottom, scroll only in center */
.page {
  height: 100dvh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: stretch;
  padding-top: calc(clamp(16px, 4vh, 32px) + env(safe-area-inset-top));
  padding-bottom: calc(clamp(16px, 4vh, 32px) + env(safe-area-inset-bottom));
  padding-left: var(--page-side-padding);
  padding-right: var(--page-side-padding);
  gap: clamp(12px, 2vh, 24px);
}

.top,
.bottom {
  position: relative;
  z-index: 8;
}

/* Top text */
.top-line {
  text-align: center;
  font-weight: 900;
  letter-spacing: 0;
  font-size: clamp(20px, calc(var(--main-scale) * 0.27), 60px);
  max-width: 100%;
  word-break: break-word;
}

/* Center scrollable block */
.center {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  --edge-fade-shift: clamp(18px, 2.5vh, 34px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.center::before,
.center::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(130px, 28vh, 280px);
  pointer-events: none;
  z-index: 6;
}

.center::before {
  top: calc(var(--edge-fade-shift) * -1);
  background: linear-gradient(to top, rgba(229, 232, 235, 0), #e5e8eb 78%);
}

.center::after {
  bottom: calc(var(--edge-fade-shift) * -1);
  background: linear-gradient(to bottom, rgba(229, 232, 235, 0), #e5e8eb 78%);
}

.name-scroll {
  --name-size: var(--main-scale);
  --intro-offset: clamp(130px, 24vh, 300px);
  --photo-size: 0.512em;
  --photo-offset-x: 0em;
  --photo-offset-y: 0.60em;

  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 4px;
}

.name-scroll::-webkit-scrollbar {
  display: none;
}

.name {
  text-align: center;
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.02em;
  font-size: var(--name-size);
  padding-top: var(--intro-offset);
  padding-bottom: clamp(180px, 30vh, 380px);
}

.name .line {
  display: block;
}

.name-link,
.project-link {
  display: block;
  width: max-content;
  margin-inline: auto;
  padding-inline: 0.08em;
  padding-block: 0;
  line-height: inherit;
  color: inherit;
  text-decoration: none;
  transition: color 150ms ease;
  font-size: 0.9em;
}

.name-link:hover,
.name-link:focus-visible,
.project-link:hover,
.project-link:focus-visible {
  color: #c70d28;
}

.project-link-logo {
  position: relative;
}

.project-link-logo .project-label {
  position: relative;
  z-index: 1;
}

.project-link-logo .project-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  height: 60%;
  transform: translate(-50%, -50%);
  color: #c70d28;
  pointer-events: none;
  z-index: 3;
}

.project-link-logo .project-logo svg {
  width: 100%;
  height: 100%;
  display: block;
}

.project-link-logo .project-logo path {
  fill: currentColor;
}

.project-link-logo:hover .project-logo,
.project-link-logo:focus-visible .project-logo {
  color: #000;
}

/* Photo overlay */
.photo {
  font-size: var(--name-size);
  position: absolute;
  left: calc(50% + var(--photo-offset-x));
  top: calc(var(--intro-offset) + var(--photo-offset-y));
  transform: translateX(-50%);
  width: var(--photo-size);
  height: var(--photo-size);
  overflow: hidden;
  pointer-events: none;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* Bottom links */
.bottom-line {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 6vw, 88px);
  font-weight: 900;
  letter-spacing: 0;
  font-size: clamp(20px, calc(var(--main-scale) * 0.27), 60px);
  flex-wrap: wrap;
  text-align: center;
  padding-right: clamp(96px, 16vw, 190px);
}

.teams-corner {
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1vw, 12px);
  z-index: 9;
}

.teams-label {
  font-weight: 900;
  font-size: clamp(12px, 1.6vw, 18px);
  line-height: 1;
}

.teams-link {
  width: clamp(24px, 2.6vw, 38px);
  height: clamp(24px, 2.6vw, 38px);
  overflow: hidden;
  display: inline-block;
}

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

.bottom-line a {
  color: #000 !important;
  text-decoration-line: underline;
  text-decoration-thickness: 0.085em;
  text-underline-offset: 0.12em;
  text-decoration-color: currentColor;
  word-break: break-word;
  white-space: normal;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.bottom-line a:hover,
.bottom-line a:focus-visible {
  color: #c70d28 !important;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: clamp(12px, 3vw, 28px);
}

.overlay.is-open {
  display: flex;
}

.overlay-panel {
  position: relative;
  width: min(920px, 100%);
  max-height: 88vh;
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #000;
  padding: clamp(22px, 4vw, 42px);
}

.overlay-panel::-webkit-scrollbar {
  display: none;
}

.overlay-close {
  position: absolute;
  right: 10px;
  top: 6px;
  border: 0;
  background: transparent;
  color: #000;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  transition: color 150ms ease;
}

.overlay-close:hover,
.overlay-close:focus-visible {
  color: #c70d28;
}

.overlay-content {
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.5;
  max-width: 72ch;
}

body.overlay-open {
  overflow: hidden;
}

.project-link-air .project-logo {
  color: #ff6501;
  transform: translate(-50%, -50%) scale(0.8);
}

.project-link-vegas .project-logo {
  --vegas-mask-scale-em: 0.725em;
  --vegas-mask-offset-x: 0em;
  --vegas-mask-offset-y: 0.11em;
  width: calc(var(--vegas-mask-scale-em) * 9.1667);
  height: var(--vegas-mask-scale-em);
  background-color: currentColor;
  -webkit-mask-image: url("assets/vegas_mask.jpg");
  mask-image: url("assets/vegas_mask.jpg");
  -webkit-mask-mode: luminance;
  mask-mode: luminance;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: translate(
    calc(-50% + var(--vegas-mask-offset-x)),
    calc(-50% + var(--vegas-mask-offset-y))
  );
}

.project-link-air:hover .project-logo,
.project-link-air:focus-visible .project-logo {
  color: #ff6501;
}

.project-link-lepota .project-logo {
  --lepota-svg-offset-y: .035em;
  color: #000;
  height: 0.69em;
  width: auto;
  transform: translate(-50%, calc(-50% + var(--lepota-svg-offset-y)));
}

.project-link-lepota:hover .project-logo,
.project-link-lepota:focus-visible .project-logo {
  color: #ab8952;
}

.project-link-lepota .project-logo svg {
  height: 100%;
  width: auto;
  display: block;
}

.project-link-lepota .project-label {
  visibility: hidden;
}

.project-link-flyana .project-label {
  line-height: inherit;
}

.project-link-flyana {
  --flyana-gif-height: 0.672em;
  --flyana-gif-offset-x: .51em;
  --flyana-gif-offset-y: .038em;
}

.project-link-flyana .project-logo {
  width: auto;
  height: var(--flyana-gif-height);
  transform: translate(
    calc(-50% + var(--flyana-gif-offset-x)),
    calc(-50% + var(--flyana-gif-offset-y))
  );
}

.project-link-flyana .project-logo img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}

.project-link-speedcat {
  --speedcat-img-scale: 1;
  --speedcat-img-offset-x: -.9em;
  --speedcat-img-offset-y: 0em;
}

.project-link-speedcat .project-logo {
  width: auto;
  height: 0.42em;
  transform: translate(
    calc(-50% + var(--speedcat-img-offset-x)),
    calc(-50% + var(--speedcat-img-offset-y))
  ) scale(var(--speedcat-img-scale));
  transform-origin: center;
}

.project-link-speedcat .project-logo img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}

.project-link-phantom .project-logo {
  --phantom-gif-height: 0.49em;
  --phantom-gif-offset-x: .490em;
  --phantom-gif-offset-y: .04em;
  width: auto;
  height: var(--phantom-gif-height);
  transform: translate(
    calc(-50% + var(--phantom-gif-offset-x)),
    calc(-50% + var(--phantom-gif-offset-y))
  );
  transform-origin: center;
}

.project-link-phantom .project-logo img {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}
